I am trying to automate web based application based on Silverlight technology. For this purpose i am using Selenium rc and making use of java for the automation purpose. Can anyone give me a simple code in java how to automate any silverlight object lets say a button or a dropdown etc. I tried googling but when it comes to automation of silverlight using selenium, I am not getting anything which is relevant to my use. Please help me out.
Thanks in advance,
Kil
16 Answers, 1 is accepted
You can take a look at our automated studio for silverlight and ajax.
http://www.telerik.com/products/web-testing-tools.aspx
All the best,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
My project requirement is such that I have to use Selenium Rc using Java script for automation purpose. Can you please post a sample java code to automate any silverlight object like a drop down menu or button etc.
Thanks,
Kil
you need to work with the html bridge to achieve this. Please take a look at this tutorial:
http://www.silverlight.net/learn/quickstarts/htmlbridge/
We don't have anything specific in our controls - so you should be able to access them as any managed object in SL.
Sincerely yours,
Valentin.Stoychev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thanks for the speedy response. Let me look into this and i will get back to you if i need some further help.
Cheers,
Kil
My aim is to set a value in a drop down menu of a website designed in silverlight through a java code. I am trying to automate using Selenium Rc. Can anyone help me out with this? Any pointers on this is highly appreciated.
Thanks in advance,
Kil
In order to achieve your goal, you basically have to do the next steps:
1. Create your SL application with the desired drop-down menu.
2. Create a way to set the content of the drop-down menu (probably a Button, whose "Click" event handler, sets the content).
3. Expose this method to JavaScript as is described here.
4. Create an html button in the host page and bind its "onclick" event to the method exposed from the SL.
5. Record a test against this page with "Selenium IDE". In this test you will just push the HTML button and it will set the content of the drop-down menu in the SL application,
6. Export the recorded test as "JUnit" test.
At this point you should have the desired test in JAVA, which you can further alter or improve.
Best wishes,
Vladislav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Selenium IDE fails to capture the actions performed on a Silverlight object. Thats the reason why I am writing a script manually and trying to interact with SL objects. If you have any other solution, I will be glad to implement it.
Thanks in advance,
Kil
I have prepared a sample project for you.
It demonstrates how to expose Silverlight methods to JavaScript, which can be called from the host HTML page and how to connect this method to a simple action, like the "onclick()" method of a regular HTML button.
In this project, there is a simple Silverlight application with one RadDropDownButton (without content initially) and a Button, which sets the content of the above control.
In the host HTML page, there is a regular HTML button, which also sets the content of the RadDropDownButton inside the Silverlight.
There is a folder named "Selenium" in the attached project, which contains one very simple test directly recorder with the Selenium IDE. And the same test, exported as "JUnit" test.
I hope that this example will give you "an overview" of how you can interact with the Silverlight application using Selenium.
Greetings,
Vladislav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I am trying to automate silverlight application using selenium RC, can any body tell the procedure,
Is it same as automating flex using selenium RC.
Thanks,
Sri
You can check my previous posts in this thread.
They contain a description of the procedure along with a small sample project demonstrating it.
Please don't hesitate to ask if you have additional questions/comments on the subject.
Kind regards,
Vladislav
the Telerik team
i have 2 queries
1.Is it possible to test silverlight application using selenium as i am not able to view sourcecode and that is why i am not able to enter the exact parameter.
2.I get an XHTML doc from my developers end but i am not able to write script from it.
is there any plugin available to view source code and if available how to use it with selenium ide and rc
please mention steps
thanks in advance
mohit
Selenium can be used for testing Html (Web apps). Integrating it with Silverlight will require exposing each needed proeprty / object as a scriprable member in the Silverlight application's code which may me not be maintainable.
This is an OS project for this:
http://code.google.com/p/silverlight-selenium/
Our Web UI Test studio can be used for painless functional tests for Silverlight:
http://www.telerik.com/automated-testing-tools/products/silverlight_testing.aspx
Kind regards,
Miroslav
the Telerik team
Hi
I hope i will find my answer here.
I'm not an English speaker i hope i will be understood
I'm also facing the same challenge: Automation of Silverlight controls using Selenium
My questions are:
1) Is it possible to automate test case using Selenium for Projects code with Silverligth?
2) Can it be possible using the C# Language?
3) If it is possible could i have an example of code plz?
4) Is it possible to have the results of the tests managed by Testlink?
Thank you for yours answers
For testing Silverlight I would recommend using our Test Studio and Telerik Testing Framework. More information you can find here:
Silverlight testing with Test Studio
Test Studio vs. Telerik Testing Framework
Code snippets and documentation you can find here: Getting Started with Silverlight UI Automation
Moreover, if you are using Progress Telerik UI for Silverlight you can take advantage of the built-in wrappers for our components. These wrappers expose rich API by numerous methods and properties that save time and efforts when writing functional tests.
I hope this information is helpful.
Regards,
Milena
Telerik by Progress
In this automation tool we decide the best tool is most popular is selenium testing tool.
http://www.traininginmarathahalli.in/selenium-training-in-bangalore/
Hi,
I want to automate the application develoepd in silverlight. Can you let me know whether there are any open source tools are available which can be used for automating SilverLight app.
Thanks.