Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Issue for clicking cancel button in a dialog box

View previous topic View next topic Go down

Issue for clicking cancel button in a dialog box

Post by sumanpasupula on 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

sumanpasupula

Posts : 2
Join date : 2011-04-12

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by qappbc on 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.

qappbc
Amateur
Amateur

Posts : 38
Join date : 2011-10-13

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by ccnnll on 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>

ccnnll

Posts : 6
Join date : 2011-12-03

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by qappbc on Tue Dec 06, 2011 4:48 am

maybe use the button attribute: aria-disabled="false"

qappbc
Amateur
Amateur

Posts : 38
Join date : 2011-10-13

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by faramka on Tue Dec 06, 2011 2:58 pm

@ccnnll, try to use:
Code:
xpath("//span[text()='Cancel']");

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by ccnnll on Tue Dec 06, 2011 9:38 pm

Thanks so much for the suggestions - faramka's xpath worked!

ccnnll

Posts : 6
Join date : 2011-12-03

Back to top Go down

Re: Issue for clicking cancel button in a dialog box

Post by Sponsored content Today at 11:02 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum