Telerik Forums
Testing Framework Forum
7 answers
30 views

Hi,

I'd like to test a WPF app that uses Telerik UI for WPF. I downloaded the Testing Framework. But I can't seem to click a RadRibbonButton by calling "button.User.Click()" method, even though the "button" variable seems to correctly point to the button:

using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;
using Telerik.WebAii.Controls.Xaml.Wpf;

namespace UnitTestProject1
{
    public class MainWindow : XamlElementContainer
    {
        public MainWindow(VisualFind find)
            : base(find)
        {
        }

        public void ClickSave()
        {
            const string Path =
                "XamlPath=/Grid[0]/Grid[0]/Grid[0]/AdornerDecorator[0]/ContentPresenter[0]/RadRibbonView[0]/Grid[0]/Grid[0]/ContentPresenter[0]/Grid[0]/RibbonScrollViewer[0]/Grid[0]/ContentPresenter[0]/ItemsPresenter[0]/RibbonGroupsPanel[0]/RadRibbonGroup[0]/Grid[0]/GroupChrome[0]/Border[0]/Grid[0]/ContentPresenter[0]/ItemsPresenter[0]/RibbonButtonsPanel[0]/RadRibbonButton[1]";
            var button = this.Get<RadRibbonButton>(Path);
            button.User.Click();
        }
    }
}


I attach a sample project that demonstrate this behavior.

I'd appreciate any suggestions.

Thanks,

Tetsu

Plamen Mitrev
Telerik team
 answered on 20 Mar 2019
18 answers
205 views
Hi,

I have added our DLL to a Test Studio project thru Show->Scripts options.
When I got back to the coded step and tried to add a 'using' statment to include the above DLL,
it was not showing (All the other MS dll and Teleriks show).
The DLL I'm trying to add has been generated using VSE 2008 and contains various test methods written
with webaii methods.

Please let me know how it's suppose to be done.

Ta.
Elena
Telerik team
 answered on 15 Mar 2019
5 answers
53 views
Hi,

is there a way to force WebAii to start chrome in Incognito mode?

Motivation: we use chrome as the default browser and before we starting the gui tests with chrome we reset the browsers cache and cookies to have a vanilla browser. this of course removes all our personal settings.
if we could start the browser in incognito mode, the browser would be "vanilla" per definition and only the telerik extension would be enabled and therefor no other extensions could influence the test execution and expected results.

thanks for advance,
Bernhard
Daniel Djambov
Telerik team
 answered on 13 Mar 2019
1 answer
40 views

Hi,

I have such an code:

 

var dropDownWorkflow = SelectTable_Column(0);

dropDownWorkflow.SelectByText((string)parameter_in["workflowValue"], true);

where

internal HtmlSelect SelectTable_Column(int index)

{     

var idString = string.Format("id=?RulesTable_Row{0}TemplateCol", index);    return myBrowser.WaitForElement(new HtmlFindExpression(idString), TestDefinitions.WAIT_TIMEOUT).As<HtmlSelect>();

}

This is the exception:

ArtOfTest.WebAii.Exceptions.ExecuteCommandException : ExecuteCommand failed!
InError set by the client. Client Error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at mshtml.HTMLSelectElementClass.IHTMLElement3_FireEvent(String bstrEventName, Object& pvarEventObject)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, String data)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeEvent',Target:'ElementId (tagName: 'select',occurrenceIndex: '0')',Data:'onchange--@@--null',ClientId:'Client_3d56ac5e-800e-4e93-bba8-e10af338144e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at mshtml.HTMLSelectElementClass.IHTMLElement3_FireEvent(String bstrEventName, Object& pvarEventObject)
   at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeEvent(IHTMLElement target, String data)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlSelect.SelectByText(String text, Boolean invokeOnChangeEvent)

 

What can be the reason and how can I solve this problem.

Thanks.

 

Elena
Telerik team
 answered on 07 Mar 2019
1 answer
16 views

Hi,

When using Chrome with the NavigatTo method, if the target url causes the browser to display a certificate error/warning the NavigateTo method times out and throws an exception. Which causes you to be unable to use any current work around to bypass the error screen and navigate to your intended URL. If I manually navigate past the certificate error page, the NavigatTo method then releases the browser object.

I am using the most recent version of the test framework 2019.2 and the most recent version of the Telerik extension 2019.1. The only work around I have is a try catch finally but the timeout is too long for our intended purposes.

 

Thanks!

Daniel Djambov
Telerik team
 answered on 04 Mar 2019
6 answers
28 views

Hello,

I have seen previous posts about this but they are quite old. So, I preferred to create a new one just in case.

I had a test with Telerik  ArtOfTest.WebAii version 2017.3.1206.0. It has been working perfectly fine for months.
Last week I had to do a minor change to something unrelated to this issue and I decided to upgrade to version 2018.3.1004.

The browser being used is IE 11.2125 (English version)

            handler.WaitUntilHandled(35000);
After doing this upgrade the Download Dialog handler stop working as it used to do. So, I got the timeout exception because the Dialog is no longer getting handled.

Here I put the code but I haven't modified this. I just put it if there is something extra that I should be doing:


                DownloadDialogsHandler handler = new DownloadDialogsHandler(manager.ActiveBrowser, DialogButton.SAVE, atestadoSavedLocation, manager.Desktop);

            //Trigger the dialog.
            manager.DialogMonitor.Start();

            clickDescargar.Invoke(); //triggers the download

            handler.WaitUntilHandled(35000);


Could you give me any hint on how to sort this out?
Regards,
Sebastian
Plamen Mitrev
Telerik team
 answered on 01 Mar 2019
3 answers
19 views
I have a bunch of old tests written with the free testing framework with Visual Studio.  Is there some way I can load these into the Test Lists in Test Studio and run them?
Elena
Telerik team
 answered on 26 Feb 2019
1 answer
4 views

We would like to store the tests, along with the specific list of components of the telerik testing framework, into the repository. This would help individual automation tester to merely retrieve the artifacts from the repository and execute the tests instead of having the the telerik testing framework installed on their pcs. How feasible is this approach?

 

Plamen Mitrev
Telerik team
 answered on 26 Feb 2019
24 answers
43 views

Hello,

I am using testing framework. in my computer its work fine. but in another computer the test fail.

the code:

            Settings settings = new Settings();
            settings.ClientReadyTimeout = 100;
            settings.Wpf.DefaultApplicationPath = applicationPath;
            Manager manager = new Manager(settings);
            var process = Process.GetProcesses().FirstOrDefault(t => t.ProcessName.StartsWith("AAA"));
            if (process != null)
            {
                manager.Start();
                manager.ConnectToApplication(process);
            }

when I run the test with debugging:

            var window = Manager.Current.Applications[0].MainWindow;

window is null.

when I run the test without debugging the exception is:

            Exception thrown: 'System.ApplicationException' in ArtOfTest.WebAii.dll
            Additional information: Unexpected error. SyncWaitResult was null for this wait

           at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
           at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
           at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
           at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
           at ArtOfTest.WebAii.Wpf.WpfApplication.get_MainWindow()

Elena
Telerik team
 answered on 17 Jan 2019
3 answers
8 views

Hello,

Recently I have started using Testing Framework to test WPF applications (MVVM). Maybe it's the novice's problem but i can't generate RoutedEventArgs on my_button.User.Click(); Operations like TypeText() or Click() should be treated like a normal user actions, aren't they?

 

I am trying something like this:

 _wpfWindow.Find.ByName(UI_Components.Button_LogIn).User.Click();

or

 _wpfWindow.Find.ByName(UI_Components.TextBox_Name).User.TypeText(login, 1, 5, true);

 

During click on LogIn Button (by real mouse)  is activating method, by Click() option not. The same problem I have with generating events for KeyPress:

private void OnKeyDownPressed(object sender, KeyEventArgs e)
{
          if (e.Key == Key.Enter)
                  runXXX();
}

private void OnLoginButtonClick(object sender, RoutedEventArgs e)
{
           runXXX();
}

How can i fix it or generate KeyEventArgs or RoutedEventArgs. Btw. I couldn't change the code from this both methods, necessary condition.

Greetings.

Nikolai
Telerik team
 answered on 16 Jan 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Liu
Top achievements
Rank 1
Iron
Alex
Top achievements
Rank 1
Veteran
Iron
Iron
George C.
Top achievements
Rank 2
Iron
Veteran
Top users last month
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Psyduck
Top achievements
Rank 4
Bronze
Bronze
Iron
Liu
Top achievements
Rank 1
Iron
Alex
Top achievements
Rank 1
Veteran
Iron
Iron
George C.
Top achievements
Rank 2
Iron
Veteran