Python script will help us to open new browser, When we run the script via any ide(cmd prompt) new browser will open but when the same script run via jenkins project it will not open browser.
Currently working on creating new jenkins project and adding my python script on that same project. Jenkin project will build at specific time. meanwhile python script will run.
My Python Code:
import webbrowser
webbrowser.open(' https://www.google.com/ ', new = 2)
Can any one help me out to open a browser when i run the python script via jenkin's project.
u need headless browser plugin
in jenkins there plugin call Xvfb plugin
use of xvfb pugin
Jenkins--> Global Tool Configuration
Directory in which to find Xvfb executable /usr/bin (its for ubuntu)
then go to your jobs ==> Configure --> under Build Environment enable tick here Start Xvfb before the build, and shut it down after.
Installing and Configuring xvfb here you can refer how to install xvfb in your pc
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.