Issue Recognizing Button in JQuery Application

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Zhilll
Posts: 13
Joined: Thu Oct 06, 2011 2:48 pm

Issue Recognizing Button in JQuery Application

Post by Zhilll » Thu Mar 14, 2013 3:10 pm

I'm currently working to automate the UI testing of an application using JQuery. One of the JQuery widgets on the page contains buttons. When creating these buttons in the repository and trying to click them in the code (myButton.click( );) Ranorex is returning the following error message:

Item 'ClassificationHierarchyCatalogTestsRepository.ClassificationHierarchyCatalog.ClassificationAndSuggestions.EditClassificationsWidget.ShowRecentBtn' is no Button.

As far as I can tell, this is a button. I checked the repository code and it is returning (or trying to return) a <Ranorex.Button>. The Spy tool is labeling this as a button, so I'm not sure what the problem is. I have attached a Ranorex Snapshot of one of these button objects for reference. Please advise. Thanks!
Attachments
AssignButtonRxSnapshot.rxsnp
(595.46 KiB) Downloaded 278 times

Zhilll
Posts: 13
Joined: Thu Oct 06, 2011 2:48 pm

Re: Issue Recognizing Button in JQuery Application

Post by Zhilll » Thu Mar 14, 2013 7:50 pm

I think I figured out what is happening. To troubleshoot this issue, I used the recorder and clicked on the same button and it worked when playing it back. The recorder added the button to the repository as a <Ranorex.ButtonTag> which worked. When I identified the same button using the spy and added it to the repository, it was added as a <Ranorex.Button> which didn't work. So I guess my question now is why is the spy identifying this as a <Ranorex.Button> while the recorder is adding the button as a <Ranorex.ButtonTag>?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Issue Recognizing Button in JQuery Application

Post by Support Team » Fri Mar 15, 2013 2:21 pm

Hello,

You could simply edit the path of your repository element (buttontag instead of button).
Another way would be to modify the 'Adapter Type' to buttontag in the properties of your repository element.

Regards,
Markus (T)
.
Image

Zhilll
Posts: 13
Joined: Thu Oct 06, 2011 2:48 pm

Re: Issue Recognizing Button in JQuery Application

Post by Zhilll » Mon Jun 03, 2013 5:57 pm

Thanks Markus. I'm able to work around the issue, but I'm wondering if this will ever be fixed? I do think it is a defect in Ranorex since the actual object type (Ranorex.buttontag) is not being returned by the spy.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Issue Recognizing Button in JQuery Application

Post by Support Team » Tue Jun 04, 2013 1:22 pm

Hello,

The element in your application is actually a ButtonTag.
The Button is the short name for ButtonTag (web apps) and for common buttons (desktop apps).
Unfortuntaely, this ambiguilty causes that you would need to use ButtonTag instead of Button.

We will discuss this issue with our developers in order to provide a possible fix for that.

Thank you.

Regards,
Markus (T)
.
Image