Invoke UI from pseudo console












0














We have some UI test cases which we are currently invoking manually on our Linux machine (with Gnome enabled). 
We login to the machine and run the below command:



java -jar test_case.jar


to invoke the test case. This opens the browser and performs the application test, and then writes the logs and quits.



Now I am planning to automate this in a Jenkins Pipeline Job. 
But I am not sure what would be the right way to do this,
because I believe Jenkins Pipeline Job gets executed in a pseudo terminal,
whereas I believe the above command should be executed in a Gnome console.



Is there a way to automate this scenario?










share|improve this question




















  • 1




    You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
    – Ramon Poca
    Dec 17 at 19:53












  • It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
    – Parthasarathy Venugopal
    Dec 18 at 3:15
















0














We have some UI test cases which we are currently invoking manually on our Linux machine (with Gnome enabled). 
We login to the machine and run the below command:



java -jar test_case.jar


to invoke the test case. This opens the browser and performs the application test, and then writes the logs and quits.



Now I am planning to automate this in a Jenkins Pipeline Job. 
But I am not sure what would be the right way to do this,
because I believe Jenkins Pipeline Job gets executed in a pseudo terminal,
whereas I believe the above command should be executed in a Gnome console.



Is there a way to automate this scenario?










share|improve this question




















  • 1




    You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
    – Ramon Poca
    Dec 17 at 19:53












  • It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
    – Parthasarathy Venugopal
    Dec 18 at 3:15














0












0








0







We have some UI test cases which we are currently invoking manually on our Linux machine (with Gnome enabled). 
We login to the machine and run the below command:



java -jar test_case.jar


to invoke the test case. This opens the browser and performs the application test, and then writes the logs and quits.



Now I am planning to automate this in a Jenkins Pipeline Job. 
But I am not sure what would be the right way to do this,
because I believe Jenkins Pipeline Job gets executed in a pseudo terminal,
whereas I believe the above command should be executed in a Gnome console.



Is there a way to automate this scenario?










share|improve this question















We have some UI test cases which we are currently invoking manually on our Linux machine (with Gnome enabled). 
We login to the machine and run the below command:



java -jar test_case.jar


to invoke the test case. This opens the browser and performs the application test, and then writes the logs and quits.



Now I am planning to automate this in a Jenkins Pipeline Job. 
But I am not sure what would be the right way to do this,
because I believe Jenkins Pipeline Job gets executed in a pseudo terminal,
whereas I believe the above command should be executed in a Gnome console.



Is there a way to automate this scenario?







linux centos gnome jenkins






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 17 at 19:51









G-Man

12.9k93364




12.9k93364










asked Dec 17 at 18:25









Parthasarathy Venugopal

142




142








  • 1




    You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
    – Ramon Poca
    Dec 17 at 19:53












  • It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
    – Parthasarathy Venugopal
    Dec 18 at 3:15














  • 1




    You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
    – Ramon Poca
    Dec 17 at 19:53












  • It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
    – Parthasarathy Venugopal
    Dec 18 at 3:15








1




1




You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
– Ramon Poca
Dec 17 at 19:53






You either need a "headless" browser or an X11 display available for the test process: e.g. start a Xvfb :1 & and set export DISPLAY=:1 before starting the java process. Another option is using Xvnc to be able to connect remotely and see the test runs.
– Ramon Poca
Dec 17 at 19:53














It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
– Parthasarathy Venugopal
Dec 18 at 3:15




It is a virtual machine. Do I need to install any additional packages to start Xvfb ?
– Parthasarathy Venugopal
Dec 18 at 3:15










1 Answer
1






active

oldest

votes


















1














Xvfb (X Virtual Frame Buffer) can be used for this purpose. It allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.



On CentOS, you can install Xvfb from the core CentOS repository with yum:



yum install xorg-x11-server-Xvfb


Once Xvfb is installed, prefix your command with xvfb-run to use it:



xvfb-run java -jar test_case.jar


xvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489542%2finvoke-ui-from-pseudo-console%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Xvfb (X Virtual Frame Buffer) can be used for this purpose. It allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.



    On CentOS, you can install Xvfb from the core CentOS repository with yum:



    yum install xorg-x11-server-Xvfb


    Once Xvfb is installed, prefix your command with xvfb-run to use it:



    xvfb-run java -jar test_case.jar


    xvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.






    share|improve this answer


























      1














      Xvfb (X Virtual Frame Buffer) can be used for this purpose. It allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.



      On CentOS, you can install Xvfb from the core CentOS repository with yum:



      yum install xorg-x11-server-Xvfb


      Once Xvfb is installed, prefix your command with xvfb-run to use it:



      xvfb-run java -jar test_case.jar


      xvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.






      share|improve this answer
























        1












        1








        1






        Xvfb (X Virtual Frame Buffer) can be used for this purpose. It allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.



        On CentOS, you can install Xvfb from the core CentOS repository with yum:



        yum install xorg-x11-server-Xvfb


        Once Xvfb is installed, prefix your command with xvfb-run to use it:



        xvfb-run java -jar test_case.jar


        xvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.






        share|improve this answer












        Xvfb (X Virtual Frame Buffer) can be used for this purpose. It allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.



        On CentOS, you can install Xvfb from the core CentOS repository with yum:



        yum install xorg-x11-server-Xvfb


        Once Xvfb is installed, prefix your command with xvfb-run to use it:



        xvfb-run java -jar test_case.jar


        xvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 18 at 10:18









        Haxiel

        1,154310




        1,154310






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489542%2finvoke-ui-from-pseudo-console%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre