locked
Test Silverlight with TestNG and Selenium RRS feed

  • Question

  • Hi,

    I was wondering if it was possible to test Silverlight by using TestNG and Selenium? I need to test a web application that consists of Wickets and Silverlight. I can test the Wickets part with TestNG and Selenium, and now I'd like to do the same with Silverlight.

    Could this be done via HTML Bridge (http://msdn.microsoft.com/en-us/library/cc645076%28v=VS.95%29.aspx)?

    Thanks in advance :)

    Tuesday, November 9, 2010 6:05 AM

Answers

All replies

  • Hi Zoolok,

    Since Scriptable method is supported in Silverlight 4, in theory, it should work. [http://www.hanselman.com/blog/UnitTestingSilverlightWithSelenium.aspx] However, for testing in Silverlight, we usually use Silverlight Unit Test Framework. http://code.msdn.microsoft.com/silverlightut

    Best regards,

    Jonathan

    Friday, November 12, 2010 4:13 AM
  • Thanks, we've checked that option, but we need a bit more than that. As far as I can tell, this only exposes methods, while we need components.

    In any case, thank you for your time :)

    Friday, November 12, 2010 6:02 AM
  • Hi Zoolok,

    As far as I can tell, this only exposes methods, while we need components.

    What do you really mean by this?

    Best regards,

    Jonathan

    Sunday, November 14, 2010 10:10 PM
  • Well, we need to be able to use Silverlight components (buttons, textfields, checkboxes etc.) as if they were "normal" HTML components. We need to be able to click buttons, fill in text fields as well as other automated testing stuff.

    Now, it is my understanding that you can't really do that with Silverlight and Selenium. As far as I can tell, Silverlight will only expose methods, while the components themselves will remain hidden. Am I right?

    Monday, November 15, 2010 3:07 AM
  • Hi Zoolok,

    Now, it is my understanding that you can't really do that with Silverlight and Selenium. As far as I can tell, Silverlight will only expose methods, while the components themselves will remain hidden. Am I right?

    Yes.  You cannot visit its Button control directly in ASP.NET.  However, for a test, you can expose the Scriptable method which use AutomationPeer to raise events.  For example, we can use ButtonAutomationPeer to raise the Button click event on code behind.    

    Best regards,

    Jonathan

     

    Tuesday, November 16, 2010 2:10 AM
  • Thanks for your help, you've given us some useful information :)

    Wednesday, November 17, 2010 9:41 AM