Telerik Forums
Testing Framework Forum
8 answers
220 views

Hello everyone,

I am really new to Telerik Testing Framework and I found my first kind of a blocker. I need to locate a dropdown.

The HTMl is attached.

The following attempts are not successful:

RadDropDownList typeDropdown = manager.ActiveBrowser.Find.ByContent<RadDropDownList>("l:One off");

HtmlSelect typeDropdown = manager.ActiveBrowser.Find.ByContent<HtmlSelect>("l:One off");

 

When I try to locate it as a simple element and to click on it is OK:

var typeDropdown = manager.ActiveBrowser.Find.ByContent("l:One off"");

 

I am really sorry if my question is not clear or is on the wrong place.

 

Best reagrds,

Iliya I.

 

Iliya
Top achievements
Rank 1
 answered on 24 Feb 2018
2 answers
229 views
I have the following problem with Telerik Testing Framework (TTF): there is a ~20 sec delay between launching my WPF application and the execution of the first step in my test.
Interestingly enough, there is no delay when connecting to my WPF application (after manually launching it), or when running the test in Test Studio 2016 (this version does not have the ‘Convert to Unit Test’ feature, so I cannot compare my code against the code in Test Studio that launches the application).
Here is the code in question:
// Launch the application
WpfApplication wpfApp = Manager.Current.LaunchNewApplication(@"filepath");
 // Click the File menu button
wpfApp.MainWindow.Find.ByTextContent("File").User.Click();

I run my tests in C# Visual Studio 2015. I have tried to use ‘Settings.ClientReadyTimeout’ and ‘Settings.ExecuteCommandTimeout,’ but these do not seem to have an effect on this.
I am sure there is something silly that I am missing, as I am new at test automation. I hope that someone can shed some light on this issue and point me in the right direction.

Thanks,

-Enrique

Enrique
Top achievements
Rank 1
 answered on 19 Feb 2018
6 answers
119 views

Result Message:
Test method InternalPortalTests.AAALoginToImpersonation.AAALoginUsingImpersonation threw exception: 
System.NullReferenceException: Object reference not set to an instance of an object.

The Element definition was:

 public ArtOfTest.WebAii.Controls.HtmlControls.HtmlButton IAgreeButtonTag
        {
            get
            {
                return _manager.ActiveBrowser.Find.ByExpression<ArtOfTest.WebAii.Controls.HtmlControls.HtmlButton>("tagname=button", "InnerText='I Agree'");
            }
        }

The line that called the element is:

            allpages.IAgreeButtonTag.Click(false);

The Dom Section I'm using is attached.

 

Any ideas? 

 

I'm bewildered by how hard it is to get any TestStudio test converted to MStest to work.

Elena
Telerik team
 answered on 14 Feb 2018
3 answers
508 views

Here is the sample code

    [TestClass]
    public class UnitTest1
    {
        private Manager m_manager;

        [TestInitialize]
        public void TestInitialize()
        {
            var mySettings = new Settings { Web = { DefaultBrowser = BrowserType.Chrome } };
            m_manager = new Manager(mySettings);
            m_manager.Start();
            m_manager.LaunchNewBrowser();
        }

        [TestCleanup]
        public void TestCleanup()
        {
            m_manager.Dispose();
        }

        [TestMethod]
        public void NavigateToGoogle()
        {
            m_manager.ActiveBrowser.NavigateTo("https://google.com/");
        }
    }

Assuming the following build to a telerick.dll

This is the command I am using from cmd prompt

MSTest.exe /testcontainer:"C:\POC1\Telerik\Telerik\bin\Debug\Telerik.dll"

When I run using command I am getting the following error, it runs perfectly fine when I use VisualStudio.

          <Message>Initialization method TelerikTestingFramework.UnitTest1.TestInitialize threw exception. System.TypeInitializationException: System.TypeInitializationException: The type initializer for 'ArtOfTest.WebAii.Core.Settings' threw an exception. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified..</Message>
          <StackTrace>    at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly&amp; lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType&amp; attributeType, IRuntimeMethodInfo&amp; ctor, Boolean&amp; ctorHasParameters, Boolean&amp; isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
   at System.Reflection.RuntimePropertyInfo.GetCustomAttributes(Type attributeType, Boolean inherit)
   at ArtOfTest.WebAii.Core.Settings..cctor()
 --- End of inner exception stack trace ---
    at ArtOfTest.WebAii.Core.Settings..ctor()

 

 

Elena
Telerik team
 answered on 14 Feb 2018
1 answer
65 views
Is it possible to do a data driven find expression in the testing framework?
Elena
Telerik team
 answered on 12 Feb 2018
1 answer
115 views

Hello,

I will try to depict my scenario as best as possible:

Browser:  Internet Explorer 11
To simplify: I have a rather simple Web Test in which I have to connect a Popup window and then  download a file. 

My code is like this: 

 

//Connect to Popup

Manager.WaitForNewBrowserConnect("https://someWebAdresss", true, 15000);
 Manager.ActiveBrowser.WaitUntilReady();

 

 DownloadDialogsHandler handler = new DownloadDialogsHandler(ActiveBrowser, DialogButton.SAVE, savedLocation, Manager.Desktop);

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

handler.WaitUntilHandled();

 

The issue I am facing right now is that the Download handling is really slow when executed with Telerik. By contrast, if I do this manually it's completely normal. Let me clarify this: the "toolbar" which offers the Save As appears but it takes (sometimes) a lot of time to execute. And then, when the download path is being set it also takes a lot of time.

What I would like to know is whether I am doing something wrong or if there is any way to speed up this.
PS: I have attached a sample of the download toolbar window to be more clear but this is not the actual image of my test.
Regards,
Sebastian

Nikolay Petrov
Telerik team
 answered on 07 Feb 2018
3 answers
147 views

Hello.

Telerik Testing Framework try to simulate mouse click (UserInteraction.Click) using method SendInput to interact with application, but mouse click does not occur.

The main reason is that method SendInput used in x86 architecture maner.

Structure ArtOfTest.WebAii.Win32.Input does not support that in x64 length of field type 8 instead 4.

The problem is discussed in my question on stackoverflow  - C#: The unmanaged method SendInput does not work with different representation of the structure .

The main question is whether the Testing Framework supports architecture x64?

If yes, can you fix that problem?

If no, can you throw exception at test initializing? - It is common practice that users immediately understand the problem.

 

 

 

Nikolay Petrov
Telerik team
 answered on 24 Jan 2018
5 answers
67 views

Hi,

I am using Telerik Testing Framework for UI automation. I have a test in which WaitForNewBrowserConnect() is throwing an exception only in Firefox browser and the same test works fine in IE, Chrome. Previously when we faced this issue, we resolved by using SetNewBrowserTracking(True). But however, no approach is working for now. We also tried calibrating the Firefox browser after the update but to no avail.

      .SetNewBrowserTracking(true);
                docLink.MouseClick(); 
                myManager.WaitForNewBrowserConnect("help", true, 30000);
                myManager.ActiveBrowser.WaitUntilReady();
                myManager.SetNewBrowserTracking(false);
                result = myManager.ActiveBrowser.PageTitle;// Getting the Help title to a string.
                myManager.ActiveBrowser.Close();//Closing the Help

 

Setup details - 

Browser - Firefox Quantum (57.0.2 (64-bit))

Extension - Progress Test Studio Version 2017.3.103.1    

Testing Framework - 2017.3.1206.0 (ArtOfTest)

Nikolay Petrov
Telerik team
 answered on 08 Jan 2018
1 answer
78 views

Hi,

we evulate different Test Automation Tools and in Test Studio we have a Problem.

 

If i select for a record the Firefox Browser than the test studio closed by itself.

 

We use Firefox ESR 45.9.0

 

Test Studio apparently does not recognize the version.

 

Best Regards

Fabian

Elena
Telerik team
 answered on 12 Dec 2017
8 answers
393 views

Hi Admin,

I am trying to automate a application in which on switching from one page to another page execute command failed exception comes.
Switching happens when a button is clicked on home page using click() method which switches to another page of application.
Error generated is below
ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_8b8c8968-8891-495b-b872-90eb95904be1',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.IO.IOException: Pipe is broken.
   at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
   at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.WriteCommandToPipe(PipeCommand command, PipeStream pipe, Boolean waitForDrain)
   at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
After this exception the active browser becomes null
ActiveBrowser.IsConnected  gives false and also Manager.ActiveBrowsers count is 0

 

Note:- When i run the test in debug mode and when i perform the click () operation the following exception is not received and ActiveBrowser.IsConnected comes true and after that test runs smoothly

Solution Tried:-
I have applied  Thread.Sleep(10000) before click on the button which takes me to next page and 
also after clicking the button.


Elena
Telerik team
 answered on 05 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?