What is a Window Handle in Selenium Webdriver?

0 votes
Can anyone explain what is a Window Handle in Selenium Webdriver?
May 12, 2019 in Selenium by Fardeen
1,672 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, 2019 by Sharath

Related Questions In Selenium

0 votes
1 answer

What is the best way to handle a Javascript popup using Selenium Webdriver?

Hello Dimple, the simplest way to handle ...READ MORE

answered May 10, 2019 in Selenium by Pratibha
• 3,690 points
2,925 views
0 votes
1 answer

What is a Session Id in Selenium Webdriver?

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

answered Aug 21, 2019 in Selenium by Abha
• 27,930 points
489 views
0 votes
1 answer
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
16,812 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
3,085 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,890 points
2,344 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,890 points
2,489 views
0 votes
1 answer

What is a Modular Framework and why it is useful in Selenium webdriver?

Hi Junaid, as the name suggests, Modular ...READ MORE

answered May 12, 2019 in Selenium by Abha
• 27,930 points
3,256 views
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, 2019 in Selenium by Anvi
• 14,090 points
565 views