-2

How to handle javascript alert message popup in selenium web driver i need selenium web driver code please

how to click on ok button using selenium web driver

enter image description here

1

1 Answer 1

0

You can try something like this: driver.switchTo().alert().accept();

to accept the Javascript alert. This might help you more: Handling Javascript alerts

Sign up to request clarification or add additional context in comments.

4 Comments

i did that but in my web site when i am changing year than showing first alert message are you sure? and then after showing another popup which shown in above screen shot so for first one popup i did and it works but second alert message doesnt work driver.switchTo().alert().accept(); code
Make sure you have enough wait between the first switchTo() and the second one.
Between the two switchTO(), just add Thread.sleep(3000); and see what happens.
stackoverflow.com/questions/48800641/… can you please answer for this question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.