SpecFlowOSS / SpecFlow.Actions

BSD 3-Clause "New" or "Revised" License
57 stars 53 forks source link

SpecFlow.Actions.Browserstack Samsung Browser Driver #90

Closed tomrobinsonv closed 2 years ago

tomrobinsonv commented 2 years ago

Is it possible to get support for Samsung Browsers with Browserstack?

SabotageAndi commented 2 years ago

@tomrobinsonv can you point me to some documentation for it? Then I can answer your question.

tomrobinsonv commented 2 years ago

I can't find many docs specifically for samsung browsers but when connecting to browserstack manually, it seems the only difference is the browser capability value being 'samsung' instead of 'chrome' or 'safari'. I'd imagine a json config file for it would look something like this?

{ "selenium": { "defaultTimeout": 15, "pollingInterval": 5, "browser": "Samsung", "capabilities": { "os_version": "10.0", "device": "Samsung Galaxy S20", "real_mobile": true, }, "browserstack": { "url": "https://hub-cloud.browserstack.com/wd/hub/" }

} }

tomrobinsonv commented 2 years ago

A bit old now, but it appears it's possible to open the Samsung browser using a chrome driver if you can add experimental options to the driver on initialisation. Could I pass these options in the capabilities object?

https://medium.com/samsung-internet-dev/how-to-use-webdriver-and-chromedriver-to-automate-samsung-internet-e1249814823e

SabotageAndi commented 2 years ago

Ok, the info with the browser capability helps. I need to think a little bit about how to add this. 🤔

mrampass commented 2 years ago

@tomrobinsonv I have not tried it myself, but by looking at the BrowserStack documentation,below config should work with the existing implementation for chrome?

{ "selenium": { "defaultTimeout": 15, "pollingInterval": 5, "browser": "chrome", "capabilities": { "device":"Samsung Galaxy S20", "os_version": "10", "real_mobile": true, "browser":"samsung", "build": "Example" },

Code from BrowserStack capability generator ChromeOptions capability = new ChromeOptions(); capability.AddAdditionalCapability("os_version", "10.0", true); capability.AddAdditionalCapability("device", "Samsung Galaxy S20", true); capability.AddAdditionalCapability("real_mobile", "true", true); capability.AddAdditionalCapability("browserstack.local", "false", true); capability.AddAdditionalCapability("browser", "samsung", true);

mrampass commented 2 years ago

Have tested the below config and it works against latest version of specflow.actions.browserstack code { "selenium": { "browser": "chrome", "capabilities": { "device": "Samsung Galaxy S20", "os_version": "10", "real_mobile": true, "browser": "samsung", "browserstack.user": "", "browserstack.key": "" }
} }

SabotageAndi commented 2 years ago

Awesome @mrampass!