开发者

How would I access a pop ui button?

开发者 https://www.devze.com 2023-03-05 04:05 出处:网络
I have a pop up button that is triggered by deleting an object. How can I click the button if I can seem to find it.

I have a pop up button that is triggered by deleting an object. How can I click the button if I can seem to find it.

I have used xpath like so:

$browser.button(:xpath, "/html/body/div/div/div/div/div/div/button").click
开发者_Python百科

Here is a code snippet:

How would I access a pop ui button?

Thanks in advance.


Try this:

browser.span(:text => "Delete").click

or

browser.span(:class => "ui-button-text).click

or

browser.button(:class => /ui-button/).click


I am not sure exactly which button are you trying to click. :) But if you are trying to click on the Delete button shown in the DOM snippet above then, you can try this xpath. "//button/span[.='Delete']"

Hope this helps.

0

精彩评论

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