Forum Discussion

Egg's avatar
Egg
Frequent Contributor
3 years ago

Using Headless Browser

Hello, When I using jenkins to execute TestComplete test at Windows server. 

Windows server display and chrome window seems like cutted. 

the windows server display seems very small and I can see chrome web page very small. 

So I use the Project Execution Plan - Local Headless Browser option. 

Some case worked through the method. 

But Some case doesn't worked and can't navigate to webpage. 

How can I handle it? 

  

  • Hi Egg,

     

    I hope you are keeping well.

     

    This issue maybe occurring due to configuration within the test. 

     

    As per the following guide ; https://support.smartbear.com/testcomplete/docs/app-testing/web/supported-browsers/headless.html

     

    To run the test in local headless browsers you will need to update the Test to use the webdriver of the desired browser, the url and the screen resolution;

     

     

    Please let me know if the configuration changes resolves your query or if you have any additional questions.

     

    Thanks,

    Shane

     

    • RJA's avatar
      RJA
      Frequent Visitor

      Having a similar problem trying headless Chrome and I wonder if anybody can help!

      Run ChromeDriver on Win10 (and it reports that is running on localhost port 9515)

      Running a simple function in BDD script:

      //var server = "localhost";
      var server = "localhost:9515";
      var capabilities = {
      "browserName": "chrome",
      "screenResolution": "1920x1080"
      };

      var url = "https://google.com";
      Browsers.RemoteItem(server, capabilities).Run(url);
      Delay(2000);

      Setting server to localhost or localhost:9515 won't make a difference and once it gets to the Delay(2000) line, it stops with error "Unable to connect to the remote browser".

    • Egg's avatar
      Egg
      Frequent Contributor

       

      I succeeded that way. 

      Thanks your help I appreciate it😄

       

    • Egg's avatar
      Egg
      Frequent Contributor

      Dear SBegley 

      I solved that headless browser issue to your help....

      but  occurred another problem. So I ask help to you.. 

      What's the 'An error occurred while trying to execute a command on the remote browser.'??

      and captured screen is black. 

      Please check my Testcomplete Result image. 

       

      Thank you 🙂 

  • Hi Egg 

     

    From the details you will be able to pinpoint where the test is failed.

     

    Can you share the following details tabs, which will shed more light on why the test is failing;

     

     

    Thanks,

    Shane