robotframework / robotframework/SeleniumLibrary
'options' argument in 'open browser' not honored when 'browser' argument is set to 'edge' or 'safari'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Problem statement:
Executing tests using Remote webdriver on BrowserStack but the options object passed under the 'options' parameter under the 'open browser' keyword doesn't get honored when the 'browser' parameter is set to 'edge' or 'safari'.
However, this works when the 'browser' argument is set to either 'chrome' or 'firefox'.
Note: The same also works across all browser argument values when using selenium 3.141.0 and desired_capabilities
Setup information:
python 3.7.12
robotframework 5.0.1
robotframework-seleniumlibrary 6.0.0
selenium 4.3.0
Steps to repro:
- Create the below-mentioned files:
test.robot
*** Settings ***
Library SeleniumLibrary
Library Collections
Library test.py
*** Variables ***
${test_url}= https://google.com
${USERNAME}= %{BROWSERSTACK_USERNAME}
${ACCESSKEY}= %{BROWSERSTACK_ACCESS_KEY}
${REMOTE_URL}= https://${USERNAME}:${ACCESSKEY}@hub-cloud.browserstack.com/wd/hub
*** Keywords ***
Open Session
${opts}= browserstack test
open browser remote_url=${REMOTE_URL} url=${test_url} options=${opts} browser=edge
*** Test Cases ***
Quick Test
Open Session
close browser
test.py
from selenium.webdriver.edge.options import Options
def browserstack_test():
edge_options = Options()
bstack_caps = {
"os" : "Windows",
"osVersion" : "8",
"debug" : "true"
}
edge_options.set_capability("browserVersion", "90")
edge_options.set_capability("bstack:options", bstack_caps)
return edge_options
========================================
- Create a free account on BrowserStack
- Set the BrowserStack username and accesskey of the account under the following env variables on your machine:
BROWSERSTACK_USERNAME
BROWSERSTACK_ACCESS_KEY - Run the test --> robot test.robot
You'll notice that the test runs on a random version of Edge and the 'options' argument doesn't seem to get honored at all.


Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction files test.robot and test.py, then trace how the open browser keyword handles the options argument for the edge and safari browser values. Run robot test.robot with the supplied Selenium and BrowserStack setup, and compare the resulting capabilities with chrome and firefox. Done means the options are honored for edge and safari as well.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100