Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getWindowHandle function doesn't exist for driver in Selenium

I need to implement switch from one window to another in IE. However, element driver doesn't support getWindowHandle function.

I assume it might be just configuration problem or settings, though I don't know how to fix it.

Please, any suggestions.

I'm working with c# - Visual Studio

like image 886
u_untouchable Avatar asked Sep 18 '26 18:09

u_untouchable


1 Answers

You haven't said which language bindings you're using, but based on a comment you posted, it looks like you're using C#. The method names are slightly different for each language binding. From this answer:

The object, method, and property names in the .NET language bindings do not exactly correspond to those in the Java bindings. One of the principles of the project is that each language binding should "feel natural" to those comfortable coding in that language.

So you have to do a little translation if you're trying to copy-paste Java code. In this case, you want the combination of the WindowHandles property (to look for the new window handle) and the CurrentWindowHandle property of the driver. You can find full API documentation for the .NET bindings at the project's Google code site.

like image 67
JimEvans Avatar answered Sep 21 '26 23:09

JimEvans