Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58838

Browsers not launching through Jenkins

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          v2v 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

          Show
          v2v 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
          Hide
          iamsharathgangadhar Sharathkumar K G added a comment -

          According to Victor Martinez, this is an environmental issue which might be regarding how the agent has been set up, bear in mind the agents are not launched in an interactive mode and any spawn processes from the build might not be tracked either.
          kindly suggest me regarding this.

          Show
          iamsharathgangadhar Sharathkumar K G added a comment - According to Victor Martinez, this is an environmental issue which might be regarding how the agent has been set up, bear in mind the agents are not launched in an interactive mode and any spawn processes from the build might not be tracked either. kindly suggest me regarding this.

            People

            • Assignee:
              Unassigned
              Reporter:
              iamsharathgangadhar Sharathkumar K G
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: