Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» 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

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

selenium-Webdriver

View previous topic View next topic Go down

selenium-Webdriver

Post by anita.totad88 on Fri May 25, 2012 3:59 pm

Hi All,

The problem I am facing here that actually i need to click on alert message dialog "Ok"
the code is here
"span class="jsx30button_text" style="position: relative; display: inline-block; height: 12px;" jsxtabindex="0" tabindex="0">Delete "/span"

but i tried with following commands:
//span[@class='jsx30button_text']
but it did not work.
could you please help on this

anita.totad88

Posts : 8
Join date : 2012-05-25

Back to top Go down

Re: selenium-Webdriver

Post by rohit13 on Fri May 25, 2012 4:31 pm

As alert is java-script generated, n you are using webdriver..Use below command
Code:
IAlert alert = driver.SwitchTo().Alert();
string alertText = alert.Text;// Get the text
alert.Accept();// Accept

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: selenium-Webdriver

Post by anita.totad88 on Fri May 25, 2012 5:10 pm


it didn't work..

anita.totad88

Posts : 8
Join date : 2012-05-25

Back to top Go down

Re: selenium-Webdriver

Post by Arahant on Mon May 28, 2012 12:22 pm

Try with following steps.

1) After click on web element which is going to popup alert dialog.
2) Then use this code.

drive.switchTo().alert().accept();

Hope will work..

Arahant
Active particpant
Active particpant

Posts : 23
Join date : 2012-02-29

Back to top Go down

Re: selenium-Webdriver

Post by ashish_techie on Tue May 29, 2012 2:23 pm

YES, YOU CAN USE THIS CODE

drive.switchTo().alert().accept();

OR

Alert alert = driver.switchTo().alert();
// alert.accept(); - to click OK
// alert.dismiss(); - to click cancel

it will work if it is a Alert. To check this you can see the page source.


regards
Ashish Thakur

For selenium training visit www.qtpselenium.com/selenium-training




ashish_techie
Amateur
Amateur

Posts : 73
Join date : 2011-08-09

Back to top Go down

Re: selenium-Webdriver

Post by Sponsored content Today at 8:11 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