0

I managed to set up a Node + Hub on my own pc.

I have a file called run_parallel_test.py that simply just creates a process to execute test scripts based on sys args, which are just browser configs with capabilities.

The command would be as follows:

python run_parallel_tests.py testrunner.py browsers.json

testrunner.py is basically Python's unittest framework executing test suites.

The issue I am having is before, I was hooked with browser stack and not selenium grid, I was able to pass browser capabilities such as this:

    [
  {
    "browser": "Chrome",
    "browser_version": "71.0 beta",
    "os": "Windows",
    "os_version": "10",
    "resolution": "1920x1080"
  },
  {
    "browser": "Firefox",
    "browser_version": "blah blah",
    "os": "Windows",
    "os_version": "10",
    "resolution": "1920x1080"
  }
]

Now with a grid, those capabilities no longer work, and I have created barebone capabilities to simply run my tests such as:

    [
  {
    "browserName": "chrome",
    "browser_version": "71.0 beta",
    "platform": "WINDOWS"
  },
  {
    "browserName": "firefox",
    "browser_version": "64.0 beta",
    "platform": "WINDOWS"
  },
  {
    "browserName": "chrome",
    "platform": "WINDOWS"
  },
  {
    "browserName": "internet explorer",
    "platform": "WINDOWS"
  }
]

The issue is, I no longer can set the resolution etc via my JSON file config as I was before when using browser stack. Is there a way to set up the resolution?

I have checked: https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities I could not find the documentation for it. Maybe I am looking at the wrong place.

1 Answer 1

1

You can't set that via the server/grid because they don't setup a container for your browser to run in like browser stack. You will need to set the browser size in your python code via the set_window_size command

Sign up to request clarification or add additional context in comments.

1 Comment

Hmm if thats the case, whats the best way to differentiate and run resolution based on desktop/tablet/mobile. Capabilities would be the same, but If I hard code the resolution it will always be whatever the code implies. I see there is a property for desiredCapabilities: commandLineFlags maybe leverage this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.