Skip to content

A sample repo to help you add an extension for automation test in Pytest for LambdaTest. Run your automation tests in Pytest in with an extension on Lambdatest.

License

Notifications You must be signed in to change notification settings

Riadayal/Pytest-add-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

How to add extension for automation test in Pytest for LambdaTest

If your webapp requires an extension for automation test in Pytest for Lambdatest, you can use the following steps to upload extension and run your test. You can refer to sample test repo here.

Steps:

Step 1: Get the zip file (Skip this if you already have the zip file with you)

Note: You will need the Chrome Extensions's ID for this. I am referring it to as $ID$. You can get the $ID$ from the URL of the Chrome Extension page.

  1. Install your desired chrome extension on chrome.
  2. Go to Chrome's Extensions page (chrome://extensions/), Enable the developer mode (check the developer mode box) and take note of the ID for your desired extension.
  3. Your extension will be located at:

For Unix, ~/.config/google-chrome/Default/Extensions/$ID$

For Windows, C:\Users<Your_User_Name>\AppData\Local\Google\Chrome\User Data\Default\Extensions$ID$

For OSX, ~/Library/Application Support/Google/Chrome/Default/Extensions/$ID$

Step 2: Upload the zip file to LamdbaTest using API

  1. Copy the link to your extension which will look something like - https://automation-prod-user-files.s3.amazonaws.com/extensions/orgId-XXXX/2.1.0_0.zip

Step 3: Pass extension in capabilities

In the conftest.py file, you need to update the test capabilities and add the extension capability. For example:

capabilities = {
        "build": "Sample PY Build",
        "platformName": "Windows 11",
        "browserName": "Chrome",
        "browserVersion": "latest",
        "lambda:loadExtension": "https://automation-prod-user-files.s3.amazonaws.com/extensions/orgId-XXXX/2.1.0_0.zip"
}

Step 4: Run your test

cd tests //navigate to tests directory
python sample_todo.py

Links:

LambdaTest Community