0

How can I run Selenium Web Driver using a button in HTML?

In most of the tutorials that I've read/watched regarding how to use Selenium Web Drivers, they code it and launch the browser and let the script manipulate things in the browser. But what if the browser is already open, and there's a button which when clicked, will run the script for the Selenium Web Driver?

How to do that?

Ank
  • 1,864
  • 4
  • 31
  • 51
  • You want to attach to an existing browser instance? It's not supported. You can try here: https://stackoverflow.com/questions/8344776/can-selenium-interact-with-an-existing-browser-session. But YMMV. – orde Jun 29 '17 at 03:47

1 Answers1

0

To do this, you'll need to setup a CI/CD like Jenkins. Create a job in Jenkins which runs the automated Selenium tests. Every job has an api to trigger it remotely.

Use this API in the HTML page you have in the button click to invoke the script.

Ashish Deshmukh
  • 448
  • 4
  • 17