What is a Window Handle in Selenium Webdriver?

0 votes
Can anyone explain what is a Window Handle in Selenium Webdriver?
May 12 in Selenium by Fardeen
35 views

1 answer to this question.

0 votes

Hi Fardeen, a Window Handle is a unique identifier that holds the address of all the windows. This is basically a pointer to a window, which returns the string value. This window handle function helps in getting the handles of all the windows. It is guaranteed that each browser will have a unique window handle. Some of the windowhandle functions are: 

  • get.windowhandle(): helps in getting the window handle of the current window
  • get.windowhandles(): helps in getting the handles of all the windows opened
  • set: helps to set the window handles which is in the form of a string.  set<string> set= driver.get.windowhandles()
  • switch to: helps in switching between the windows
  • action: helps to perform certain actions on the windows.
answered May 13 by Sharath

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What is a Session Id in Selenium Webdriver?

Hey Uruj, in Selenium Webdriver Session ID ...READ MORE

answered Aug 21 in Selenium by Abha
• 22,870 points
27 views
0 votes
1 answer
+1 vote
2 answers
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,090 points
556 views
0 votes
1 answer
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,130 points
891 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
554 views
0 votes
1 answer
0 votes
1 answer

What is POM in Selenium and what it is used for?

Hello Rubina, POM is Page Object Model which ...READ MORE

answered May 12 in Selenium by Anvi
• 12,840 points
159 views