Telerik Testiing Framework

9 posts, 0 answers
  1. Catriona
    Catriona avatar
    13 posts
    Member since:
    Jul 2013

    Posted 15 May 2014 Link to this post

    I'm trying to use the Telerik Testing Framework (Not Studio) to run tests with NUnit.
    I have only just started with your testing framework so are probably asking some "newbie" questions (Sorry).

    I have to use IIS as I'm using VS20103.
    I have looked at your example code QuickSTarts_NUnit/AspNetANdTestRegion.
    I have used this as a basis for my test.
    I have a couple of questions.
    1. When using your BaseTest, How do I get access to the TextFixture to start my IIS as the start of all my tests?
    2. How do I shut down a browser at the end of a test? A Manager.RemoveBrowser(ActiveBrowser.ClientId) doesn't seem to do this.
    3. When running TestMethod2 and TestMethod2B both browsers are left running. If I do this.CLeanup() in test MyTestCleanUp() this has no affect.

    My aim is to start IIS at the beginning of the Tests, Load a page and perform some tests.
    Some tests will load different pages in the same browser.
    I want to test my javascript
    I want to test multiple pages (Although I think I read that this wasn't possible).

    I've attached my simple test project only TestMethod2 & TestMethod2B work at all.
  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 16 May 2014 Link to this post

    Hello Catriona,

    Please take a look at the following article on getting started with Telerik Testing Framework. I hope you will also find useful automating browser actions.
    On accessing TextFixture you should look over the internet for a solution since this is beyond our scope of the support expertise. You can find this article helpful.
    About closing the browser you can simply use:

    ActiveBrowser.Close();

    About testing Javascript take a look at Invoking Javascript funtions article.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. Catriona
    Catriona avatar
    13 posts
    Member since:
    Jul 2013

    Posted 19 May 2014 Link to this post

    Using the links you gave me and looking through the sample code I have a test project started.

    I am now trying to use the samples from C:\Program Files (x86)\Telerik\Test Studio\Samples\Telerik Controls Wrappers\ASP.NET AJAX\Input. I want to find a RadTextBox and put some text in there.

    When I attempt to do this I can see that the text is written (If I look closely) but then I get MouseCLick;LeftCLick and timeout waiting for the text. See RadControlsWebApp3_RadTextBox.pdf in zip file (actually real project not sample given which exhibits same problem)

    Is it not possible to use these HtmlControls when using IIS as the WebServer? 

    If I use below, it does set the text. But how to "Wait" to check the text written?

    Element PRJobIdTextBoxEl = ActiveBrowser.Find.ById("ctl00_ContentPlaceHolder1_ctl00_PRJobIdTextBox");

    ActiveBrowser.Actions.SetText(PRJobIdTextBoxEl, PRJobId);


  4. Catriona
    Catriona avatar
    13 posts
    Member since:
    Jul 2013

    Posted 19 May 2014 Link to this post

    Some additional information which may help you see my problem.

    Using my test harness I tried running your sample code Samples\TelerikControlWrappers\ASP.NET AJAX\Input\TextBox.cs the test SingleLineTextBox and this exhibited the same behaviour. The only change I made was to specify the full path.

    ActiveBrowser.NavigateTo(http://demos.telerik.com/aspnet-ajax/input/examples/radtextbox/firstlook/defaultcs.aspx);


  5. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 20 May 2014 Link to this post

    Hello Catriona,

    Please provide me with a sample demo of the test you are using against our controls so I can take a look and be able to execute it.

    Looking forward to hearing from you.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  6. Catriona
    Catriona avatar
    13 posts
    Member since:
    Jul 2013

    Posted 20 May 2014 in reply to Catriona Link to this post

    Please find my sample project. I have added the test SingleLineTextBox() from the samples "C:\Program Files (x86)\Telerik\Test Studio\Samples\Telerik Controls Wrappers\ASP.NET AJAX\Input\TextBox.cs".
    I am using VS2013, IIS.
  7. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 21 May 2014 Link to this post

    Hello Catriona,

    Thank you for providing me with the testing project, however I had multiple issues building it and working with it since I don't have IIS running on my machine right now.
    Since you are working with our Sample Tests project which is demonstrating the use of RadControl WebAii Wrappers. Here is an example test on typing into a RadTextBox control:

    [TestMethod]
    public void SingleLineTextBox()
    {
        Manager.LaunchNewBrowser();
        ActiveBrowser.NavigateTo("/input/examples/radtextbox/firstlook/defaultcs.aspx");
     
        RadTextBox textBox = Find.ById<RadTextBox>("RadTextBox1_wrapper");
     
        Assert.AreEqual("type here", textBox.EmptyMessage);
     
        // simulate typing
        textBox.TypeText("some text", 100);
        textBox.Blur();
     
        Assert.AreEqual("some text", textBox.InputValue);
    }

    That test should be running against this ASP.NET AJAX live demo.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  8. Catriona
    Catriona avatar
    13 posts
    Member since:
    Jul 2013

    Posted 21 May 2014 in reply to Ivaylo Link to this post

    Thank you for the reply, unfortunately that was one of the test I was running in my environment. I had copied it into my test harness to see if it would work. It doesn't as it gives the same error as I indicated for my actual tests. Basically no data has been written to the textbox.

    I've found that I can use ActiveBrowser.Actions.SetText() to set the text and look at the data using the RadTextBox html controls.

    So now I guess my question now is whether the (html control) RadTextBox .TypeText can be used at all or should I regard these controls as read-only and use the ActiveBrowser.Actions.SetText() for updates?

    I've attached the annotation that I get when the SingleLineTextBox is run.
  9. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 21 May 2014 Link to this post

    Hello Catriona,

    Yes, please use ActiveBrowser.Actions.SetText();  for updates for now.
    I will investigate this further and will update this ticket accordingly.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top