- sumanpasupula
- Posts : 2
Join date : 2011-04-12
Issue for clicking cancel button in a dialog box
Thu Sep 29, 2011 8:19 pm
in webdriver, am unable to click the cancel button when a new dialog box appears...
can anyone suggest me ...
thanks in advance,
Suman.p
can anyone suggest me ...
thanks in advance,
Suman.p
- qappbcAmateur
- Posts : 38
Join date : 2011-10-13
Re: Issue for clicking cancel button in a dialog box
Sat Dec 03, 2011 8:13 am
1. Try using FireFox with Firebug addon (with FirePath).
Determine what xPath aspect will identify the Cancel button.
2. After clicking Popup link, find dialogbox handle and use it to set
your driver to it: driver.switchTo().window(popupWin_ID);
3. Then use findElement(By.xpath(the Cancel button xPath identifier)).click()
I think that should work for you.
Determine what xPath aspect will identify the Cancel button.
2. After clicking Popup link, find dialogbox handle and use it to set
your driver to it: driver.switchTo().window(popupWin_ID);
3. Then use findElement(By.xpath(the Cancel button xPath identifier)).click()
I think that should work for you.
- ccnnll
- Posts : 6
Join date : 2011-12-03
Re: Issue for clicking cancel button in a dialog box
Tue Dec 06, 2011 4:40 am
I am struggling with the same issue. In my case, the problem is finding
an xpath identifier for the cancel button. It's a JS generated dialog
so the firebug xpath includes a lot of divs with instance numbers that
change so I can't use that.
I'm trying to use a contains on the
class name but don't seem to have the syntax correct to get the web
element so I can click on it.
For example, I tried the following: xpath("//span[contains(@class,'ui-button-text'/'Cancel')]"
The code looks like:
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" type="button" role="button" aria-disabled="false">
<span class="ui-button-text">Cancel</span>
an xpath identifier for the cancel button. It's a JS generated dialog
so the firebug xpath includes a lot of divs with instance numbers that
change so I can't use that.
I'm trying to use a contains on the
class name but don't seem to have the syntax correct to get the web
element so I can click on it.
For example, I tried the following: xpath("//span[contains(@class,'ui-button-text'/'Cancel')]"
The code looks like:
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" type="button" role="button" aria-disabled="false">
<span class="ui-button-text">Cancel</span>
- qappbcAmateur
- Posts : 38
Join date : 2011-10-13
Re: Issue for clicking cancel button in a dialog box
Tue Dec 06, 2011 4:48 am
maybe use the button attribute: aria-disabled="false"
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Issue for clicking cancel button in a dialog box
Tue Dec 06, 2011 2:58 pm
@ccnnll, try to use:
- Code:
xpath("//span[text()='Cancel']");
- ccnnll
- Posts : 6
Join date : 2011-12-03
Re: Issue for clicking cancel button in a dialog box
Tue Dec 06, 2011 9:38 pm
Thanks so much for the suggestions - faramka's xpath worked!
- Clicking the same button again and again but only the content changes
- having an issue with clicking on ID in a webpage
- when download button is clicked pop up dialog box displayed , i am unable to automate it.
- How to Handle Modal dialog window issue (Using Selenium IDE) in Firefox 3.0
- Multiple Button issue
Permissions in this forum:
You cannot reply to topics in this forum