Page 1 of 1

cant click on a button

Posted: Thu Jan 23, 2014 2:54 pm
by rholdberh
Hi,
i am new to Ranorex so pls forgive my silly questions. I have a button:

<button class="inforFormButton gridButton delete" name="nameofthebutton" onclick="UIHandler.deleteExport(event, '4567asd', 'Completed1_140102094515')">Delete</button>

i defined Xpath position to this button, but when i try to click on it a got a mistake:

Item 'ExportToolTestsRepository.IDMExporter.DeleteButtonPath' is no Button.
The element does not support the required capability 'button'.

code from the repository:

_deletebuttonpathInfo = new RepoItemInfo(this, "DeleteButtonPath", ".//div[#'formerExportsTable']/div[4]/div[3]/div/div[1]//button[@innertext='Delete']", 30000, null, "00c4b1d4-e020-4e57-acaf-d55db3589559");

So if i understand well i am trying to click on a text on this button but it doesnt work for me.

Re: cant click on a button

Posted: Thu Jan 23, 2014 3:23 pm
by krstcs
Technically it is not a "Button", it is a "ButtonTag" object, since it appears to be HTML.

Try declaring the object as a ButtonTag instead of Button and see what happens.

Ranorex uses Button both for actual Button objects and as a short-hand for ButtonTag objects (which is a mistake in my opinion because of confusion like this).

Re: cant click on a button

Posted: Thu Jan 23, 2014 3:32 pm
by rholdberh
Thanks!! :D with ButtonTag it works good