Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

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


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