We are experiencing an issue when running Python Script via Jenkins, the browsers refuse to open up the URL, however, when we run them manually, then it works.

      Pre Requirement:
      Firstly, Need to create a project in Jenkins.
      Next, In the project configuration-> Build section need to add below details.
      For example:-
      cd <Python_Script_Folder_Path>
      python <Python_File_Name>.py

      My Python Sample Script:
      import webbrowser
      import subprocess
      mycmd = r'start chrome /new-tab {}'.format("https://outlook.office.com")
      n2 = subprocess.Popen(mycmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

      post-execution process:
      Firstly, go to the Jenkins project and click on Build Now option.

      Expected Result:
      Default browser should be open along with given URL.

      Issue:
      The script is running successfully but browser not opening.

      Note: If you run python script via cmd prompt or any IDE works perfectly.

          [JENKINS-58838] Browsers not launching through Jenkins

          Sharathkumar K G created issue -

          I'll change the component as this is not regarding the jenkins lint plugin and also I'll unassign myself.

          Besides, I'd say based on the information you just provided, this is an environmental issue which might be regarding how the agent has been setup, bear in mind the agents are not launched in an interactive mode and any spawn processes from the build might not be tracked neither. See the below references in case they help

          https://wiki.jenkins.io/display/JENKINS/Spawning+processes+from+build

          https://support.cloudbees.com/hc/en-us/articles/229724088-How-to-set-up-a-Jenkins-agent-to-have-the-same-path-as-the-user-when-connected-via-Remote-Desktop-

           

          Other than that, I'm afraid I cannot allocate any time to do any further analysis

          Victor Martinez added a comment - I'll change the component as this is not regarding the jenkins lint plugin and also I'll unassign myself. Besides, I'd say based on the information you just provided, this is an environmental issue which might be regarding how the agent has been setup, bear in mind the agents are not launched in an interactive mode and any spawn processes from the build might not be tracked neither. See the below references in case they help -  https://wiki.jenkins.io/display/JENKINS/Spawning+processes+from+build -  https://support.cloudbees.com/hc/en-us/articles/229724088-How-to-set-up-a-Jenkins-agent-to-have-the-same-path-as-the-user-when-connected-via-Remote-Desktop-   Other than that, I'm afraid I cannot allocate any time to do any further analysis
          Victor Martinez made changes -
          Component/s Original: jenkinslint-plugin [ 20644 ]
          Victor Martinez made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Victor Martinez made changes -
          Assignee Original: Victor Martinez [ v2v ]
          Sharathkumar K G made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Sharathkumar K G made changes -
          Assignee New: Arun jose [ 0404 ]
          Sharathkumar K G made changes -
          Rank New: Ranked higher
          Sharathkumar K G made changes -
          Assignee Original: Arun jose [ 0404 ] New: Sharathkumar K G [ iamsharathgangadhar ]
          Sharathkumar K G made changes -
          Assignee Original: Sharathkumar K G [ iamsharathgangadhar ] New: Mohammed Asgar [ asgarma ]

            Unassigned Unassigned
            iamsharathgangadhar Sharathkumar K G
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: