selenium webdriver - WebDriverException: Message: Error : Platform and Browser not valid - Stack Overflow

Trying to connect to browserStack automation with the following but getting an error:WebDriverExceptio

Trying to connect to browserStack automation with the following but getting an error: WebDriverException: Message: Error : Platform and Browser not valid.

from appium.options.android import UiAutomator2Options

def my_test(self):

    options = UiAutomator2Options()
    options.set_capability("platformName", "android")
    options.set_capability("deviceName", "Google Pixel 7")
    options.set_capability("platformVersion", "13.0")
    options.set_capability("browserName", "Chrome")

    server= "hub-cloud.browserstack/wd/hub"

    self.driver = webdriver.Remote(command_executor=f"https://{my_user_name}:{my_access_key}@{server}", options=options)

    self.driver.get("https//www.example")

    self.driver.quit()

Trying to connect to browserStack automation with the following but getting an error: WebDriverException: Message: Error : Platform and Browser not valid.

from appium.options.android import UiAutomator2Options

def my_test(self):

    options = UiAutomator2Options()
    options.set_capability("platformName", "android")
    options.set_capability("deviceName", "Google Pixel 7")
    options.set_capability("platformVersion", "13.0")
    options.set_capability("browserName", "Chrome")

    server= "hub-cloud.browserstack/wd/hub"

    self.driver = webdriver.Remote(command_executor=f"https://{my_user_name}:{my_access_key}@{server}", options=options)

    self.driver.get("https//www.example")

    self.driver.quit()
Share asked Mar 3 at 21:26 Testing SinghTesting Singh 1,3631 gold badge15 silver badges27 bronze badges 1
  • If you are using BrowserStack, they have examples of how to do this in their documentation. If it's still not working, you can open a ticket and get help directly from the company. – JeffC Commented Mar 3 at 23:14
Add a comment  | 

1 Answer 1

Reset to default 1

Read the error carefully! - it says that the platform and browser are not valid. So that means the ones you have provided are either spelled wrong or do not exist.

Go to browserstack and look at the list of available devices they have and make sure that they match exactly to what you provided in the options object.

You can also use this capability generator that allows you to experiment with what they have -> https://www.browserstack/docs/app-automate/capabilities

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745071108a4609551.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信