The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
_python_code_example
_python_code_example

Running the Example Code

  1. Copy the example code and save it into a file called first_test.py.
    Make sure your username and access key are included in the URL passed through to the command_executor.
  2. Open terminal and navigate to the directory where the file is located.
  3. Execute the test:

    Code Block
    python first_test.py

Check your dashboard and you will see that your test has just run on Sauce!

Tip
titleWait!

The implicitly wait method tells the browser to wait a set amount of time (in seconds) for elements to appear on the page before giving up. Without it, slow loading DOMs could cause our tests to fail when they might otherwise pass. Using implicit waits is one of our recommended best practices.

...

If you look at the code closely, you'll see that basics for setting up a test to run on sauce are very straightforward, and really only require two elements.

Include Page
_python_quick_start
_python_quick_start

...

Running the Example Code

  1. Copy the example code and save it into a file called first_test.py.
    Make sure your username and access key are included in the URL passed through to the command_executor.
  2. Open terminal and navigate to the directory where the file is located.
  3. Execute the test:

    Code Block
    python first_test.py

Check your dashboard and you will see that your test has just run on Sauce!

Running Tests Against Local Applications

...

Sauce Connect is a tunneling app that allows you to execute tests securely when testing behind firewalls or on localhost. For more detailed information, please visit see the Sauce Connect docs

...

Reporting to the Sauce Labs Dashboard

 Recording Pass/Failure Results

...