Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update lambdatest.py
changes for desired_capibilities in the latest selinium update
  • Loading branch information
DUMBANIKET authored Jun 18, 2023
commit d17450cfe99f626ed0f00a4a0c197d65ee143296
46 changes: 23 additions & 23 deletions lambdatest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@
access_key = os.getenv("LT_ACCESS_KEY") # Replace the access key


class FirstSampleTest(unittest.TestCase):
# Generate capabilites from here: https://www.lambdatest.com/capabilities-generator/
# setUp runs before each test case and
def setUp(self):
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",
"console": 'true', # Enable or disable console logs
"network": 'true', # Enable or disable network logs
#Enable Smart UI Project
#"smartUI.project": "<Project Name>"
},
"browserName": "firefox",
"browserVersion": "latest",
}
#paste your capibility options below

options = ChromeOptions()
options.browser_version = "114.0"
options.platform_name = "macOS High Sierra"
lt_options = {}
lt_options["username"] = username
lt_options["accessKey"] = access_key
lt_options["video"] = True
lt_options["resolution"] = "1920x1080"
lt_options["network"] = True
lt_options["build"] = "test_build"
lt_options["project"] = "unit_testing"
lt_options["smartUI.project"] = "test"
lt_options["name"] = "basic_unit_selinium"
lt_options["w3c"] = True
lt_options["plugin"] = "python-python"
options.set_capability('LT:Options', lt_options)


# Steps to run Smart UI project (https://beta-smartui.lambdatest.com/)
# Step - 1 : Change the hub URL to @beta-smartui-hub.lambdatest.com/wd/hub
# Step - 2 : Add "smartUI.project": "<Project Name>" as a capability above
# Step - 3 : Run "driver.execute_script("smartui.takeScreenshot")" command wherever you need to take a screenshot
# Note: for additional capabilities navigate to https://www.lambdatest.com/support/docs/test-settings-options/

self.driver = webdriver.Remote(
command_executor="http://{}:{}@hub.lambdatest.com/wd/hub".format(
username, access_key),
desired_capabilities=desired_caps)
driver = webdriver.Remote(
command_executor="http://{}:{}@beta-smartui-hub.lambdatest.com/wd/hub".format(
username, access_key),options=options)

# tearDown runs after each test case

Expand Down Expand Up @@ -90,4 +90,4 @@ def test_demo_site(self):


if __name__ == "__main__":
unittest.main()
unittest.main()