How to Handle Alerts,Confirmation Box and Popups in Selenium Like a PRO?

promode

Pramod Dutta

Posted on September 29, 2020

How to Handle Alerts,Confirmation Box and Popups in Selenium Like a PRO?

βœ… Join us - https://sendfox.com/thetestingacademy

In this video, We are going to learn How To Handle Alerts in Selenium and How To Popups Alerts in Selenium, I am going to show step by step How to handle them with accept, dismiss and send Keys methods provided by Selenium.

πŸš€ Download code : https://codeshare.io/5wXoVK
πŸš€ Reference Link - https://medium.com/@madhankumaravelu93/selenium-cheat-sheet-a-comprehensive-list-of-selenium-commands-fa4c5c9d11ab

πŸš€ What is Javascript Alert?
One useful function that's native to JavaScript is the alert() function. This function will display text in a dialog box that pops up on the screen.
With just accept button information

πŸš€ Handling Confirm Box in Selenium

A confirm box is similar to an alert, except the user can also choose to cancel the message

A confirm box is often used if you want the user to verify or accept something.

When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.

If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.

πŸš€ What is Prompt Box and How to handle it in Selenium?
A prompt box is often used if you want the user to input a value before entering a page.

When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value.

If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box returns null.
Source - https://www.w3schools.com/js/js_popup.asp

Prompt Box
Confirm + they also include a text input.

Alert alert = driver.switchTo().alert();
alert.accept();
alert.dismiss();

πŸš€ Demo Website Used - https://the-internet.herokuapp.com/javascript_alerts

πŸš€ What is Automation Testing?
Automation testing is a Software testing technique to test and compare the actual outcome with the expected outcome.

This can be achieved by writing test scripts or using any automation testing tool.

πŸš€ What is Test automation?
Test automation is used to automate repetitive tasks and other testing tasks which are difficult to perform manually.

πŸš€Why we do Automation Testing?

  • Eliminate the manual efforts
  • Ad hoc Test- cases are required to run.
  • Rerun the critical or important cases continuously.
  • Long manual flows are tidies

πŸš€What is 30 Days of Automation in Testing Challenge?

This video is part of 30 Days of Automation in Testing Challenge. Where we will learn about the different concepts related to Automation Testing for Beginners and topics like

βœ… Automation testing features
βœ… Approaches to automation testing
βœ… What is Automation testing
βœ… Why automation testing
βœ… Automation testing frameworks
βœ… Automation testing advantages
βœ… Automation testing benefits
βœ… Automation Testing Tools
βœ… Automaton Testing Books.
βœ… Why you need automation testing.
βœ… What is UI Testing
βœ… Top Automation blogs to read.
βœ… Automation tutorials included Selenium, Cypress, Katalon Studio and Test automation frameworks and may more concepts.

βœ… API Testing using Postman -
https://www.learnapitesting.com

βœ… Cypress Tutorial with LIVE Projects -
https://cypresstutorial.com

βœ… REST API testing with Python -
https://masterapitesting.com

#seleniumtutorial #thetestingacademy #seleniumframework #seleniumjava

seleniumforbeginner

πŸ’– πŸ’ͺ πŸ™… 🚩
promode
Pramod Dutta

Posted on September 29, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related