Home > other >  Selenium webdriver in webbrowser
Selenium webdriver in webbrowser

Time:04-30

I recently got acquainted with such a thing as selenium webdriver and ran into one problem, I want to display an open page with selenium in the webrowser element, but I can't find how to do it. please tell me how using selenium can open the browser to display the page in the webrowser element (Windows Forms)

CodePudding user response:

It's not entirely clear from your question why you need to display a page from Selenium in the webrowser element (Windows Forms). If you just want to display a page, you don't have to use Selenium you can just display it in a WebBrowser with

webBrowser1.ScriptErrorsSuppressed = true;
this.webBrowser1.Navigate("your URL");

If you need to display the result after certain automated actions, you can save the HTML document into a text variable and output it to the WebBrowser.

webBrowser1.DocumentText = "text variable with the HTML text you got from the page using Selenium"
  • Related