Forum Discussion

Mohit_Dadhich's avatar
Mohit_Dadhich
Contributor
3 years ago
Solved

Remote Execution for Web picking tablet view while execution in headless mode.

Remote Execution for Web picking tablet view while execution in headless mode.as a result scripts are getting failed.

We have removed all the defined virtual browsers from current project settings and default project settings and set chrome with resol

Following are the parameters which we are using in our script - 

capabilities = 
"platform" = "Windows 10",
"browserName" =  "chrome",
"screenResolution" =  "1920x1080"

Browsers.RemoteItem["localhost", capabilities].Run(baseurl)

  • Mohit_Dadhich's avatar
    Mohit_Dadhich
    3 years ago

    Found the solution by adding few parameters in the arguments i.e. 
    args : 

    [--headless

    --window-size=1920*1080]


3 Replies

    • Mohit_Dadhich's avatar
      Mohit_Dadhich
      Contributor

      Test is not exactly failing due to Browsers.RemoteItem, but it is picking the tablet view which hides our UI control and that's the reason, our execution is failing

      We tried with both, but didn't work -

      Browsers.RemoteItem["localhost", capabilities].Run(baseurl)

      Browsers.RemoteItem["http://hub.crossbrowsertesting.com:80/wd/hub", capabilities].Run(baseurl)

      • Mohit_Dadhich's avatar
        Mohit_Dadhich
        Contributor

        Found the solution by adding few parameters in the arguments i.e. 
        args : 

        [--headless

        --window-size=1920*1080]