Failed due to exception Ranorex.CapabilityNotSupportedExcept

Ranorex Spy, Recorder, and Studio.
Rajendra
Posts: 32
Joined: Wed Sep 28, 2011 1:57 pm

Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Rajendra » Fri Jan 10, 2014 8:06 am

Hi,

I am getting following error while trying to access the textbox/button using ranorex keywords (Ranorex.Text and Ranorex.Button)

Code_1:
Text textbox="/dom[@domain='www.google.co.in']//input[#'gbqfq']";
textbox.TextValue = "Ranorex";

Failed due to exception Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'text'


Code_2:
WebElement Elem="/dom[@domain='www.google.co.in']//input[#'gbqfq']";
Elem.PressKeys("Ranorex");
This is absolutely working fine.

The same this happening for Button objects as well.

Am I missing something?

I am trying to develop a keyword driven framework. But I am facing these kind of issues while trying to develop a keywords.

Thanks,
Rajendra

Rajendra
Posts: 32
Joined: Wed Sep 28, 2011 1:57 pm

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Rajendra » Fri Jan 10, 2014 11:43 am

I guess I made a small mistake:

The below syntax is working for me:

Ranorex.InputTag input = "/dom[@domain='www.google.co.in']//input[#'gbqfq']";
input.TagValue = "Ranorex";

But, I am getting issue while trying to access buttons using below code:

Ranorex.Button btnn = "/dom[@domain='www.google.co.in']//button[@id='gbqfb']";
btnn.Click();
Failed due to exception Ranorex.ElementNotFoundException: No element found for path './/input[#'gbqfq']' within 10s.

Can some one please help me out?

Thanks,
Rajendra

Rajendra
Posts: 32
Joined: Wed Sep 28, 2011 1:57 pm

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Rajendra » Fri Jan 10, 2014 11:58 am

Sorry, the error message for the above mentioned code was:

Ranorex.Button btnn = "/dom[@domain='www.google.co.in']//button[@id='gbqfb']";
btnn.Click();

Failed due to exception Ranorex.CapabilityNotSupportedException: The element does not support the required capability 'button'.

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Swisside » Fri Jan 10, 2014 1:15 pm

Hello

Have you tried working with a repository/Spy ? It's easier to maintain I think.


Regards


EDIT: Could you try :
ButtonTag myHtmlButton="/dom[@domain='www.google.co.in']//button[@id='gbqfb']";
From the documentation :
  • - Button Represents a push button.

    - ButtonTag The HTML 'button' tag.
A simple thank you always does wonders !

Rajendra
Posts: 32
Joined: Wed Sep 28, 2011 1:57 pm

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Rajendra » Sat Jan 11, 2014 2:41 pm

hi

thanks for the quick reply.

actually, I do not want to use repository. I want to create a generic keyword driven framework.

I tried the syntax postedwabove but still nno luck

thanks
raj

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Swisside » Mon Jan 13, 2014 3:05 pm

Strange.

The buttontag adapter worked fine for me with Chrome.


Maybe try the support ?


Regards
A simple thank you always does wonders !

User avatar
mebner
Posts: 61
Joined: Tue Dec 17, 2013 6:42 pm

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by mebner » Wed Jan 15, 2014 2:11 pm

Hi,

When you work with web elements you need to ensure that you also use the right adapter types.
For instance, when you try to create an adapter for a web button: "/dom[@domain='www.google.co.in']//button[@id='gbqfb']" you need to create a ButtonTag adapter:
ButtonTag myHtmlButton="/dom[@domain='www.google.co.in']//button[@id='gbqfb']";
In the Detail's tab of Ranorex Spy you will see what Capability is used to define the specific web element:
ButtonTag.png
ButtonTag.png (27.6 KiB) Viewed 1112 times
you shouldn't face issues when you use the specific Capability shown in Spy.

Regards,
Markus

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by krstcs » Wed Jan 15, 2014 3:09 pm

Markus,

I think part of the confusion here is that Ranorex uses the same RXPath tags for two different Object types.

For example, the types Button and ButtonTag both use the RxPath "/button" by default. I think it would be better if the object and path matched.

So, the Button object would have a "/button" path by default, and the ButtonTag object would have a "/buttontag" path by default. This would clear up a lot of confusion.

You don't need to change anything but the default generator for the ButtonTag object, so no one would need to change their tests. ButtonTag would still work with the "/button" path, but by default it would generate a "/buttontag" path from now on. This would allow backwards compatibility but create a distinction between the two items.

There are other similar situations, but buttons are the most obvious.

Can we add that as a feature request?
Shortcuts usually aren't...

Rajendra
Posts: 32
Joined: Wed Sep 28, 2011 1:57 pm

Re: Failed due to exception Ranorex.CapabilityNotSupportedExcept

Post by Rajendra » Mon Jan 20, 2014 10:28 am

Hi Markus,

Thank you for the reply.

The below syntax is working absolutely fine.

Ranorex.ButtonTag btnn = "/dom[@domain='www.google.co.in']//button[@id='gbqfb']";
btnn.Click();

Thanks,
Rajendra