Handling multiple windows |tabs| browsers|Selenium WebDriver |Clear Explanation | Real time examples

Published: 14 October 2020
on channel: total-qa
145
5

Handling Multiple Windows:
====================
Hyperlinks helps the users to navigate from one page to another page.
Hyperlinks are having following syntax:

a href="url" LinkText a
a - stands for Anchor tag

Example 1:
===========

a href="signin.html" target="_blank" Sign In /a to modify your account details.
a href="signin.html" Sign In Same Page /a to modify your account details.


Example 2:
===========
Access   / r.php  
Click on 'Data Policy' link available in the webpage.
A new window is opened having title as 'Data Policy'
Switch to new window having title as 'Data Policy'
Fetch the current url of the webpage.

parent - facebook reg window
child - datapolicy window
-String parent = driver.getWindowHandle();
-SetString wNames = driver.getWindowHandles();
-driver.switchTo.window(String wname);
https://www.javadoc.io/doc/org.seleni...

3 Different Logics:
==============
Using Enhanced for loop
Using iterator
Using Arrays

Check out the blog as well http://total-qa.com
PlayList Details:
SOAPUI:
   • SOAPUI  
JIRA:

SELENIUM INTERVIEW QUESTIONS:
   • Selenium Interview Questions  
PAGE OBJECT MODEL PRINCIPLES:
   • PageObjectModel  
JENKINS:
   • JENKINS  
REST API TUTORIAL:
   • REST API TUTORIAL  
JAVA:
   • Java  
SELENIUM WEBDRIVER:
   • Selenium WebDriver  
XPATHTUTORIAL:
   • Xpath Tutorial  
CssSelector:
   • Css Tutorial  
GITHUB:
   • GITHUB