CrossBrowserTesting Support

Support

  • Product
    • Live Testing
    • Automated Testing
    • Record & Replay
    • Visual Testing
  • API Docs
  • Blog
  • Live Q&A
  • Start Testing
CrossBrowserTesting Support » Record & Replay » FAQ » Record & Replay Best Practices

Record & Replay Best Practices

Start automation with no Selenium knowledge with our Record & Replay tool using these Best Practices.

Note: Record and Replay is under active development – we try to keep this document up to date, but we make changes to the product faster than we change the documentation. Feel free to give it a try and let us know how it goes!

Record Explicitly, and with Intention

The recorder (and Selenium) needs very specific instructions on what to execute. Record as if you were explaining to someone over the phone what you want them to do. Here are some examples about being explicit:

  • Hover over a word to reveal a menu. Add a hover step so our recorder knows when to hover and what to hover over.
  • Wait for the page to load. Add a sleep if your page takes a while to load or a specific element only appears after some amount of time.
  • Scroll down until a button appears. When you scroll, we will record the scrolling. Make sure the scroll brings the element into the frame completely so our recorder knows how much to scroll to see the button.

Remember to be intentional about your steps. Record & Replay is a very powerful tool for making sure must-have functionality works on your site. If you are doing exploratory testing, this may not be the best tool for that.

Developing with Unique Elements for Record Targeting

The Recorder works best when your website is developed with the most modern web standards. Here is a quick list of recommended patterns to follow. The Recorder is looking for the most unique CSS Selector to target when building your script. The more unique & simplistic your CSS selection path, the more reliable your script will be on Playback.

  • Unique Element Ids: W3 docs
  • Unique Input Names: W3 docs
  • Unique Button Text: W3 docs
  • Targeting Nested (child) Elements: CSS Tricks

Recording your Script

  • Don’t close tabs during recording session.
  • Clean up & Remove any extraneous/accidental clicks or scrolls.
  • Input Fields Click input fields before entering text – instead of using the tab Key to switch element focus.
  • Form Submit Click submit button instead of pressing enter to submit forms.
  • Adding Hover: Exposing elements under a CSS :hover (pseudo class), use the Add Hover step instead of using the cursor.

Unsupported Cases:

  • Basic Auth – URLs protected by Basic Authentication are unsupported by Selenium, and therefore unsupported by our recorder. Though you may be able to enter username/password on recording, the credentials are not stored nor can be replayed in your scripts.
  • CAPTCHA – Forms with this security feature will fail on replays. It exists to prevent bots and your replay is exactly what it is intended to stop.
  • CSS Transformations – If you use CSS transformation to apply capitalization, some browsers will fail on replay as they look at the HTML and it is case-sensitive. Future support is planned.

Additional Tips:

  • When clicking or adding an expect to an element, keep the element in the browser viewport.
  • Avoid Testing Dynamic or Random generated content.
  • Try switching elements in our Edit mode if the replay fails
  • When using Replay, try not to change resolutions as elements may no longer be visible.

Bonus Tools:
Here are a list of tools/exercises that will help you understand CSS Selectors when developing:

  • CSS Diner Game – Test your skills!
  • Evaluate and validate XPath/CSS selectors in Chrome Developer Tools
  • developers.google – Test Selectors in Chrome Dev tools:

Related

All Topics

  • Billing and Plans
  • Frequently Asked Questions
  • Integrations
  • Live Testing
  • Local Connection
  • Screenshots
  • Selenium Testing
  • Teams and Admins
  • Team Guides



Think you need a human?

Our customer success team will be glad to help you with your question.

Contact Support

Still need a free trial?

Try CrossBrowserTesting free for 7 days and see how we make testing easier.

Start Today

Want the latest tips?

Enter your email and we’ll send you tutorials and browser testing strategies right to your inbox.


Product

  • Live Testing
  • Automated Testing
  • Visual Testing
  • Local Testing
  • Integrations

Resources

  • Browsers & Devices
  • Blog
  • Webinars
  • Security
  • ROI Calculator

Support

  • Help Center
  • CBT Community
  • API Docs
  • Automation Docs
  • Schedule A Demo
  • Enterprise Request

Company

    • About Us
    • Contact Us
    • Careers
    • Terms of Use
    • 1-888-927-6973

© 2019 CrossBrowserTesting.com, LLC. All rights reserved.