Selenium iterate over the open windows in the OS and find the right IE process to attach t (c#)

不羁的心 提交于 2020-03-26 02:32:02

问题


I am trying to reconnect a webdriver to an existing intance of Internet Explorer. After reading I was informed that With internet-explorer, it's possible to iterate over the open windows in the OS and find the right IE process to attach to (1).

But I can't get such feature to work. I believe this is a Watin feature only from reading (2).

Is such feature possible with selenium?

(1) How can I reconnect to the browser opened by webdriver with selenium?

(2)https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/18

Edit : I am working in RPA, our main tool is Blue Prism. Now I would love to be able to use selenium inside Blue Prism. But to do so, I would need to re-attach to a browser. I manage to reattach using the sessionID and URI, but it only work while the instance of the first code execution is still running (I believe once the code stop, the garbage collector clear the sessionID and it cant reattach). I need to acces it from another code stage.

I was thinking of running procces in the background to keep my selenium driver alive and reattach to it. Then when I am done, I could kill such process.

Edit2: If someone is looking for code exemple on how to reattach using sessionID and URI, you can follow this tutorial

https://tarunlalwani.com/post/reusing-existing-browser-session-selenium-csharp/

来源:https://stackoverflow.com/questions/60608840/selenium-iterate-over-the-open-windows-in-the-os-and-find-the-right-ie-process-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!