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

Automation of Silverlight controls using Selenium

16 Answers 604 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
kiljaden wow
Top achievements
Rank 1
kiljaden wow asked on 06 May 2010, 10:05 AM
Hi,

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

Sort by
0
Valentin.Stoychev
Telerik team
answered on 06 May 2010, 11:53 AM
Hi Kil,

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.
0
kiljaden wow
Top achievements
Rank 1
answered on 06 May 2010, 12:57 PM
Hi,

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
0
Valentin.Stoychev
Telerik team
answered on 06 May 2010, 01:17 PM
Hello kiljaden wow,

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.
0
kiljaden wow
Top achievements
Rank 1
answered on 06 May 2010, 01:37 PM
Hi,

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
0
kiljaden wow
Top achievements
Rank 1
answered on 14 May 2010, 07:26 AM
Hi,

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
0
Vladislav
Telerik team
answered on 18 May 2010, 09:53 AM
Hi kiljaden wow,

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.
0
kiljaden wow
Top achievements
Rank 1
answered on 18 May 2010, 03:07 PM
Hi Vladislav ,

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
0
Vladislav
Telerik team
answered on 21 May 2010, 07:17 AM
Hello kiljaden wow,

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.
0
sri sri
Top achievements
Rank 1
answered on 03 Jul 2010, 08:19 PM
Hi ,
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
0
Vladislav
Telerik team
answered on 07 Jul 2010, 03:15 PM
Hi sri 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
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
0
mohit
Top achievements
Rank 1
answered on 23 Aug 2010, 08:34 AM
Hi Everyone,

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
0
Miroslav
Telerik team
answered on 25 Aug 2010, 04:37 PM
Hello 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
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
0
Marlene
Top achievements
Rank 1
answered on 17 May 2017, 09:44 AM

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

 

0
Milena
Telerik team
answered on 22 May 2017, 08:59 AM
Hello Marlene, 

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
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Adam
Top achievements
Rank 1
answered on 20 Oct 2017, 09:36 AM

In this automation tool we decide the best tool is most popular is selenium testing tool.

http://www.traininginmarathahalli.in/selenium-training-in-bangalore/

0
smita
Top achievements
Rank 1
answered on 17 Nov 2018, 04:33 AM

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.


Tags
Buttons
Asked by
kiljaden wow
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
kiljaden wow
Top achievements
Rank 1
Vladislav
Telerik team
sri sri
Top achievements
Rank 1
mohit
Top achievements
Rank 1
Miroslav
Telerik team
Marlene
Top achievements
Rank 1
Milena
Telerik team
Adam
Top achievements
Rank 1
smita
Top achievements
Rank 1
Share this question
or