How can I get web element from a pop- up window?


When I try to get a web element from popup web window, I could not achieve it.

Could you please let me know how I should proceed?


Hello @burakkulce.
Please advise how you tried to achieve the element. Do you use XPath or image? Did you receive any exceptions?

Helloe @Lera
I tried to get via xpath. I didnot receive any exception, it did not work for any case in case of pop-up window.

Sorry, not sure that I understand you. Do you have an issue with script that should click on a link in pop-up browser window? Or do you mean that you cannot get XPath for some element that exists in pop-up?

My problem is to get webelement that exists in pop-up window.

Do you mean how to get XPath for a web element? We have basic XPath guide:
But please be informed that there are specific webpages where XPath cannot be used. It depends on how these pages are developed.

Hi Lera,
Actually I know how to get webelement from website.

However my main problem is after searching some data in a specific website, it opens a new website as popup and the data which I look for is in the new website which is opened as popup window.

So in this case, you need to do this pop-up window active. You can try with the script provided in this thread:

1 Like