Page 1 of 1

Cannot access MS SilverLight controls in IE

Posted: Thu Oct 13, 2016 10:33 pm
by ngrishakin
Looks like I cannot access any SilverLight components.
I have a search button on my page and RxPath to it is

Code: Select all

“/dom[@caption='CreateInvoice']//div[#'silverlightControlHost']/?/?/form[@name='Silverlight Control']/button[@automationid='SearchButton']/picture[@classname='Image']”
But when I try to use this path in my code I’m getting the following exception:
“Result StackTrace:
at Ranorex.Adapter..ctor(Element element)
at Ranorex.WebElement.op_Implicit(Element element)
at CatalystRnrx.ObjectRepository.CreateInvoice.get_SearchBatton() in C:\qa\BDD_Automation\CatalystRnrx\CatalystRnrx\ObjectRepository\CreateInvoice.cs:line 25
at CatalystRnrx.TestClass.TestMethod7() in C:\qa\BDD_Automation\CatalystRnrx\CatalystRnrx\TestClass.cs:line 257
Result Message: Ranorex.CapabilityNotSupportedException : The element does not support the required capability 'webelement'.”

May be it's due to trial license or I missed some references in MY VS project.
Thanks for all help!

Re: Cannot access MS SilverLight controls in IE

Posted: Fri Oct 14, 2016 7:45 am
by odklizec
Hi,

I'm afraid, there is a lot of missing info in your post so there is not much we can do for you. Please answer these essential questions:
Ranorex version (latest and greatest is 6.1)?
OS and browser name/version?
Please post a Ranorex snapshot (not screenshot) of the problematic (or its parent).
Please post the code you are using to access the control.
Also, have you tried to access the control via recording?

Re: Cannot access MS SilverLight controls in IE

Posted: Fri Oct 14, 2016 3:59 pm
by ngrishakin
Pavel, here is my information:
1. Ranorex version: 6.1
2. OS Win 7 Pro
3. IE v. 11
4. Ranorex Recorder and Play Back works fine

Ranorex Snapshot file is attached.

My Object Repository Class:

Code: Select all

public WebElement SearchBatton
    {
     get { return Host.Local.FindSingle("/dom[@caption='CreateInvoice']//div[#'silverlightControlHost']/?/?/form[@name='Silverlight Control']/button[@automationid='SearchButton']/picture[@classname='Image']", Global.WaitTime); }
        }
Now I'm calling it from NUnit test case:

Code: Select all

           createInvoice.SearchBatton.Click();
The last call returns the error:
Result Message: Ranorex.CapabilityNotSupportedException : The element does not support the required capability 'webelement'.

I would really appreciate any help on this.
Thanks!
- Nik

Re: Cannot access MS SilverLight controls in IE

Posted: Fri Oct 14, 2016 6:29 pm
by OverflowingStack
@ngrishakin,

This is a Silverlight control, specifically a picture. Therefore, your return type must be of type Ranorex.Picture or Ranorex.UIAutomation (most general Adapter type for Silverlight controls).

I hope this helps! :D

Re: Cannot access MS SilverLight controls in IE

Posted: Fri Oct 14, 2016 10:47 pm
by ngrishakin
Yes It did. Ranorex needs to update their API docs. Record and Playback is not for everyone.
Thanks a lot for your help!!!

Re: Cannot access MS SilverLight controls in IE

Posted: Sat Oct 15, 2016 10:39 pm
by Support Team
Hi ngrishakin!
ngrishakin wrote:Ranorex needs to update their API docs
It would be great if you could give as a hint on where you would expect us to improve the API docs.

Just a hint: Apart from configuration/instrumentation, we do not have specialized documentation for every technology. This is by design, since Ranorex let's you handle all technologies in a similar way.

You can find the "generic" documentation on how to work with Ranorex adapters here:
http://www.ranorex.com/support/user-gui ... apter.html

Regards,
Alex
Ranorex Team