2
votes

Using Watir I have been able to isolate this button element:

<BUTTON id=authButton class=commandButton onmousedown="$('newOrder:hiddenAuth').click();">Authorize Payment</BUTTON>

Here is my watir code:

$browser.div(:id, "rSide:j_id750_body").table(:index, 0) [1] [0] .button(:index, 0).click

I was able to see I'm on the <button> by using watir's "flash" method to highlight the button. For some reason I am unable to actually click the button. I think it might have something to do with the onmousedown code but I really don't know. Any help would be greatly appreciated.

1
I've actually solved this question myself by reading other watir questions on here. Specifically, Alister's CKEditor question found here: stackoverflow.com/questions/7025823/…. The answer was to use watir's execute_script method. Here's what I did. $browser.execute_script "$('newOrder:hiddenAuth').click(); - Conner
Please add your own answer and marked as answered. - Alister Scott

1 Answers

1
votes

The button is wired up to do some specific action when it see's the onmousedown event, so if .click is not working, the next thing to try is firing that specific event, instead of using the .click method.

If that doesn't work try forcing the javascript to execute the newOrderLhiddenAuth script.

oh and FYI for your developer, they may want to get into the habit of using lower case for their HTML tags

"the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML."