WebAii UI testingfreamework -Silverlight example

6 posts, 1 answers
  1. Rolando
    Rolando avatar
    15 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    Hi there,
    looking inside of the site, I couldn't find a good example to create tests to a silverlight  app  by code (without use testStudio).
    Any good resource?
    thank you for your help!
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 30 Nov 2011 Link to this post

    Hi Rolando,

    Here is the page you're looking for. 

    All the best,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Rolando
    Rolando avatar
    15 posts
    Member since:
    Nov 2011

    Posted 30 Nov 2011 Link to this post

    Hi,
    Thank you for the link,
    As the link says, i have to add a reference to ArtOfTest.WebAii.Silverlight, wich in the version i have installed doesn't exist. 
    The version wich i have installed is the number Testing Framework 2011.2
    I am doing something wrong?
  4. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 30 Nov 2011 Link to this post

    Hello Rolando,

    You'll find ArtOfTest.WebAii.dll in the following directory:

    • C:\Program Files\Telerik\Testing Framework 2011.2\Bin

    Once that's added as a reference to your project, you can add the following using statements:

    using ArtOfTest.WebAii.Silverlight;
    using ArtOfTest.WebAii.Silverlight.UI;

    You'll find a sample project which contains a Silverlight test that demonstrates this in the following directory:

    • C:\Program Files\Telerik\Testing Framework 2011.2\Samples\Testing Framework

    Regards,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Rolando
    Rolando avatar
    15 posts
    Member since:
    Nov 2011

    Posted 01 Dec 2011 Link to this post

    Hi again,
    Thank you for your feedback, 
    I tried to do the example but i got some problem trying launch the browser. The exception message is:
    "Exception thrown attempting to launch Internet Explorer. Please make sure Internet Explorer is properly installed and you are able to launch it."

    and the exception message from the inner exception says: "Object reference not set to an instance of an object."

    what I am doing wrong?
    As you see in the attached image, I am using BaseTest class to be able use ActiveBrowser class

    Note:
    In the next url you will see a picture showing my test class and the properties wich i have added to my html page.
    http://tinypic.com/r/2mopnoy/5
  6. Answer
    Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 01 Dec 2011 Link to this post

    Hi Rolando,

    Thank you for the screen shot.

    First, ensure you have a reference for ArtOfTest.WebAii.Core and a using statement for it, so the Settings code will be properly recognized.

    Your code is close; just make a few changes:

    [TestMethod]
    public void TestMethod1()
    {
    Settings mySettings = new Settings();
     
    //mySettings.DefaultBrowser = BrowserType.InternetExplorer;
    //above line is obosolete, use below line instead
    mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
     
    mySettings.ClientReadyTimeout = 60000;
     
    Manager myManager = new Manager(mySettings);
    //must start myManager after creating it
    myManager.Start();
     
    Settings.Current.Web.EnableSilverlight = true;
                 
    myManager.LaunchNewBrowser();
    //must call below line from myManager as well
    myManager.ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/#GridView/UIVirtualization");
     
    //when done performing actions, dispose myManager
    myManager.Dispose();
    }

    All the best,
    Anthony
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top