This is a migrated thread and some comments may be shown as answers.

WebAii UI testingfreamework -Silverlight example

5 Answers 253 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rolando
Top achievements
Rank 1
Rolando asked on 30 Nov 2011, 06:35 PM
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!

5 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 30 Nov 2011, 06:58 PM
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.
0
Rolando
Top achievements
Rank 1
answered on 30 Nov 2011, 07:17 PM
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?
0
Anthony
Telerik team
answered on 30 Nov 2011, 09:43 PM
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.
0
Rolando
Top achievements
Rank 1
answered on 01 Dec 2011, 03:53 PM
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
0
Accepted
Anthony
Telerik team
answered on 01 Dec 2011, 06:38 PM
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.
Tags
General Discussions
Asked by
Rolando
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Rolando
Top achievements
Rank 1
Share this question
or