Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Python selenium script in jenkins?

Could anyone describe the steps to run python selenium test on jenkins. python is created in eclipse on windows machine. I want to run my test every time I build my environment.

Please help me to get this started.

like image 367
Ashish Koli Avatar asked Aug 06 '26 23:08

Ashish Koli


1 Answers

Make sure you have chromedriver plugin,selenium plugin, Shining panda plugin, installed on your Jenkins(Go to Jenkins>Manage Jenkins> plugin's).

Select the step run shell script from PostBuild actions,

If you are using unittest module for writing your test's then, use the below command

#!/bin/sh
python -m unittest discover --pattern=test_testcasename.py

Please take the reference of the below link https://www.youtube.com/watch?v=nFYsO-xPaE8

like image 82
Kaushik Avatar answered Aug 08 '26 13:08

Kaushik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!