https://github.com/lambdatest/unittest-browser-options
How to set browser specific options in UnitTest on LambdaTest
https://github.com/lambdatest/unittest-browser-options
lambdatest testing unittest
Last synced: 5 months ago
JSON representation
How to set browser specific options in UnitTest on LambdaTest
- Host: GitHub
- URL: https://github.com/lambdatest/unittest-browser-options
- Owner: LambdaTest
- Created: 2022-06-07T12:36:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-08T10:32:50.000Z (about 4 years ago)
- Last Synced: 2025-10-23T11:41:16.927Z (9 months ago)
- Topics: lambdatest, testing, unittest
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to set browser specific options in UnitTest on [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=UnitTest-browser-options)
If you want to set browser specific options for an automation test in UnitTest on Lambdatest, you can use the following steps. You can refer to sample test repo [here](https://github.com/LambdaTest/UnitTest-browser-options).
# Steps:
You can specify the various browser specific options in the test file capabilities. The following is an example on how to set Chrome specific options using chromeOptions:
```python
desired_caps = {
'LT:Options': {
"build": "Python Demo", # Change your build name here
"name": "Python Demo Test", # Change your test name here
"platformName": "Windows 11",
"selenium_version": "4.0.0",
"chromeOptions" : {
"args" : ["incognito"] # ChromeOption to start chrome in incognito mode
},
"browserName": "Chrome",
"browserVersion": "98.0",
}
```
* The different options available for Chrome can be referred to [here](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_chrome/selenium.webdriver.chrome.options.html).
* For more information you can refer to this LambdaTest [blog](https://www.lambdatest.com/blog/desired-capabilities-in-selenium-testing/?utm_source=github&utm_medium=repo&utm_campaign=Pytest-browser-options).
## Run your test
```bash
python lambdatest.py
```
# Links:
[LambdaTest Community](http://community.lambdatest.com/)