Knowledge Base

  1. Home
  2. Knowledge Base
  3. Technical Support
  4. Script Commands
  5. Common Nightwatch/Selenium commands

Common Nightwatch/Selenium commands

testRTC uses the popular Nightwatch/Selenium scripting language.

For a complete reference of the Nightwatch API reference, please refer to

Here are several common commands that you are bound to find and use with testRTC:


Simulates a click event on the given DOM element.

This is usually used to click on buttons or links on your web page.


Name Type Description
selector string The CSS selector used to locate the element.


Using DOM Element ID – .click(‘#btn-login’)
Using DOM Element Class – .click(‘.btn-danger’)
Using DOM Element attribute property – .click(‘a[href=”/dashboard”]’)

Using DOM Element Xpath – .click(‘xpath’, ‘//*[@id=”uncontained_main_content”]/div[2]/a’)


Sends some text to an element. Can be used to set the value of a form element or to send a sequence of key strokes to an element. Any UTF-8 character may be specified.


Name Type Description
selector string The CSS/Xpath selector used to locate the element.
value string|array The text to send to the element or key strokes.


Suspends the test for the given time in milliseconds. If the milliseconds argument is missing it will suspend the test indefinitely.

When you pause, the browser keeps running and any action taking place in the background continues – you can use the .pause() command for example to wait for the media in the call to run its course, giving it 30, 60 or any other number of seconds to play.


Name Type Description
ms number The number of milliseconds to wait.


Retrieve the URL of the current page or navigate to a new URL.


Name Type Description
url string URL to navigate to.

Was this article helpful?

Related Articles

Leave a Reply 0 comments

Leave a Reply: