Click action in Selenium WebDriver

0 votes

I want to click on the "Ok" button of an alert window using Selenium WebDriver. I tried using assertAlert or verifyAlert but it is not working out for me.

Is it possible to click the button of an alert window?

May 15, 2018 in Selenium by Sahiti
• 6,290 points
37 views

1 answer to this question.

0 votes

You can use the below code to click on the button in an alert window using Java:

Alert alert = driver.switchTo().alert();
answered May 15, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

0 votes
1 answer

Double click a record in a grid using Selenium webdriver

Try Actions class to perform this Actions action ...READ MORE

answered Mar 29, 2018 in Selenium by Damon Salvatore
• 5,510 points
1,366 views
0 votes
1 answer

Difference between submit() vs click() in Selenium Webdriver

The submit() function is specifically for forms ...READ MORE

answered May 24, 2018 in Selenium by sniffy_god
• 780 points
2,356 views
0 votes
1 answer

How to click on Image in Selenium Webdriver?

Hello Lalit, I guess you mean to ...READ MORE

answered May 9, 2019 in Selenium by Anvi
• 14,010 points
2,037 views
0 votes
1 answer

How to perform right click action using Selenium Webdriver?

@Yuvika, you need to use Actions Class ...READ MORE

answered May 27, 2019 in Selenium by Reshma
49 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
1,479 views
0 votes
1 answer
0 votes
1 answer

What is the role of TestNG & JUnit frameworks in Selenium?

Well TestNG and JUnit are test frameworks ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,670 points
429 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,850 points
1,460 views
0 votes
1 answer

XPath for the elements with no ID or Name in Selenium Webdriver

Use like this or similar to this: //div[@id="top-level-menu-item-3"]/div[@class="filter-label"] //div[@id="top-level-menu1"] ...READ MORE

answered Apr 17, 2018 in Selenium by Meci Matt
• 9,460 points
1,690 views
0 votes
1 answer