简体   繁体   中英

How to run selenium script on remote machine using Jenkins

I've created a Selenium script in my local machine but we have to run this script in a remote server. What i would like to do is install Jenkins on this remote machine and then run my script on it 24 hours.

Is it possible to do this and if yes then how ?

Thanks.

sure you can use Jenkins to run your script "continuously", however the part of running it in a remote machine you can easily achive it while creating your WebDriver.

When you create your driver locally you do someting like driver = new ChromeDriver(capabilities) however when you create a driver to communicate with a remote server you have to create a Remote Web Driver like driver = new RemoteWebDriver(new URL("http://" + REMOTE_URL + ":4444/wd/hub"), capabilities); . For it to work tho, you have to have a selenium standalone server running in your REMOTE_URL.

For more Info take a look here: WebDriver: Advanced Usage

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM