Troubleshooting
Automating Chrome Extension in Testsigma
You can automate the Chrome extension in Testsigma using two methods:
- Hybrid Execution: Run on the Chrome browser installed on your local machine.
- Cloud Execution: Run on the Chrome browser in Testsigma Lab, SauceLabs, or Browserstack.
This article discusses setting up and running automated Chrome extension tests in Hybrid & Testsigma Lab environments.
Automating a Chrome Extension
Section titled “Automating a Chrome Extension”A Chrome extension improves the browser’s capabilities. Add extensions from the Chrome Web Store or search for the extension to find the store link.
Create a CRX File
Section titled “Create a CRX File”-
Go to CRX Viewer.
-
Select Open in this viewer.
-
Choose CRX and download the file (This file is necessary for automation).
-
Searching for .html?$ and find files like panel.html and popup.html. The popup.html file is usually the target for automation.
-
Go to chrome://extensions/ and access the popup.html file.
-
Locate the plugin you wish to automate and access its unique ID.
- In this case unique ID is epmomlhdjfgdobefcpocockpjihaabdp.
Hybrid Mode: Local Test Execution
Section titled “Hybrid Mode: Local Test Execution”-
Setup and start Testsigma Agent. For more information, refer to the documentation on setting up Testsigma Agent.
-
Place the CRX file to your Testsigma Agent folder.
-
Specify the Extensions path in the Desired Capabilities.
Name Data Type Value goog:chromeOptions String {“extensions”:[“extension.crx”]}
You can also add multiple extensions, with this format for Values: {“extensions”:[“extension1.crx”],[“extension2.crx”]}.
When the test execution starts, the desired capabilities will install the extension automatically. You can verify the installation by checking for the extension icon in the browser’s top-right corner.
With Chrome version 137, Google has disabled the use of command-line switches like —load-extension in stable builds to improve security and stability. Instead, you can configure the following in Desired Capabilities:
| Name | Data Type | Value |
|---|---|---|
| goog:chromeOptions | String | {“args”:[“—disable-features=DisableLoadExtensionCommandLineSwitch”]} |
| goog:chromeOptions | String | {“args”:[“—load-extension=Place the file path here”]} |
Steps to Get the Extension Path
Section titled “Steps to Get the Extension Path”-
Go to the Chrome Web Store and search for the Chrome extension source viewer extension.
-
Click Add to Chrome to install the extension.
-
Once added, go back to the Chrome Web Store.
-
While viewing the Chrome extension source viewer extension’s page, click the Chrome extension source viewer extension in your browser toolbar.
-
Select Download as ZIP from the available options.
-
Extract the zip file and copy the file path along with the file name.
{“args”:[“—load-extension=Place the file path here”]}
Hybrid Mode: Cloud Test Execution
Section titled “Hybrid Mode: Cloud Test Execution”Repeat the same Desired Capabilities we have discussed in the above section before executing the test plan.