We've launched a new support center at help.smartling.com. This site will continue to be maintained into January 2017. Please update your bookmarks.
Follow

Using the Chrome Context Capture Extension with Browser Automation Software

If you use browser automation software - such as Selenium, PhantomJS - for testing purposes, you can set up the Chrome Context Capture Extension to integrate with your existing test scripts and take a snapshot and any point in a script.

 

To use the Chrome Context Capture Extension with browser automation:

(1) In Chrome>Preferences>Extensions, find the Chrome Context Capture Extension, and click Options.

(2) Check Detect Automation.

(3) To take a snapshot during automation, add this code to your script.

fireSmartlingChromeExtension({ 
  "projectId": "projectUID",   
  "apiKey":"project-api-key",
  "callback":function(submissionData){
       //snapshot is submitted, move on
  }
});

Override Existing Context

By default the Chrome Context Capture Extension will not override existing context, but this behavior can be customized by using your automation script to apply Smartling HTML classes to a page or to specific elements in the DOM.

To override context for an entire page:

Add the two classes "sl-override-context sl-translate" to the page's HTML tag.

To override context for specific elements on the page:

(1) Add the "sl-notranslate" class to the HTML tag of the page.

(2) Add the two classes "sl-override-context sl-translate" to the elements you want to override context for. Any nested child elements will also be overwritten.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request
Powered by Zendesk