Riadayal / Pytest-browser-options

A sample repo to help you set browser-specific options in Pytest on LambdaTest. Run your automation test scripts in Pytest with set browser-specific options on Lambdatest.

Home Page:https://www.lambdatest.com/pytest-testing/?utm_source=github&utm_medium=about&utm_campaign=pytest_browser_options

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set browser specific options in Pytest on LambdaTest

If you want to set browser specific options for an automation test in Pytest on Lambdatest, you can use the following steps. You can refer to sample test repo here.

Steps:

You can specify the various browser specific options in the conftest.py file. The following is an example on how to set Chrome specific options using chromeOptions:

capabilities = {
       "build": "Sample PY Build",
       "platformName": "Windows 11",
       "browserName": "Chrome",
       "browserVersion": "latest",
       "chromeOptions" : {
               "args" : ["incognito"]  # ChromeOption to start chrome in incognito mode
 }
}
  • The different options available for Chrome can be referred to here.

  • For more information you can refer to this LambdaTest blog.

Links:

LambdaTest Community

About

A sample repo to help you set browser-specific options in Pytest on LambdaTest. Run your automation test scripts in Pytest with set browser-specific options on Lambdatest.

https://www.lambdatest.com/pytest-testing/?utm_source=github&utm_medium=about&utm_campaign=pytest_browser_options

License:MIT License