开发者

Firewatir: button does not click, no error

开发者 https://www.devze.com 2023-02-05 06:35 出处:网络
On a webpage (which I cannot change) I have a link like this: <a class=\"PSHYPERLINK\" href=\"javascript:submitAction_win0(document.win0,\'PRCSDETAIL_BTN$0\');\" tabindex=\"94\" id=\"PRCSDETAIL_BT

On a webpage (which I cannot change) I have a link like this:

<a class="PSHYPERLINK" href="javascript:submitAction_win0(document.win0,'PRCSDETAIL_BTN$0');" tabindex="94" id="PRCSDETAIL_BTN$0" name="PRCSDETAIL_BTN$0"> Details</a>

In my code, I put this:

browser.frame(:index, "1" ).link( :text => "Details" ).click

What happens is that the link is not clicked, or at least this makes no effect, but I receive no开发者_StackOverflow社区 error. The script simply continues. It is interesting that on the same website I am able to click other links, even if they use JavaScript like the one above. Example of link for which FireWatir works:

<a class="PSSRCHRESULTSODDROW" tabindex="32" href="javascript:submitAction_win0(document.win0,'#ICRow2');">TESTQUERY</a>


Maybe you need to fire JavaScript event: How to find out which JavaScript events fired?

Are you sure you are clicking the correct link? Link text is " Details" and you are clicking link with text "Details" (please notice space in front of the first string).

0

精彩评论

暂无评论...
验证码 换一张
取 消