Versions Compared

Key

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

...

The recorder supports the following commands:

  1. Click

  2. Double_Click

  3. Right_Click

  4. Fill

  5. Clear

  6. Select

  7. Hover

  8. Alert

  9. Switch_Window

  10. Close_Popup

  11. Check

  12. Drag_and_Drop

  13. Verify_Element

  14. Verify_Text

  15. Get_Web_Value

The recorder has two recording modes:

  1. Interactive Mode: in this mode, you will be required to enter a hint/label that can be used to generate XPaths for your test case. This mode always generates relative XPaths.

  2. Silent Mode: in this mode, you will not be required to enter a hint/label, everything will be captured automatically. This mode uses absolute XPaths by default, unless you have created XPath Templates with relative XPaths.

Note: Refer to Set Preferences to a Test Case (User Execution Preferences) to activate/deactivate the recorder and switch between modes.

...

6- You can switch between recording modes at anytime during recording. To learn how to do this, please visit Set Preferences to a Test Case (User Execution Preferences)

7- You can determine where a new step is added as follows:

...

XPath Templates are used to store XPaths by the user which can be used in the Recorder in Silent Mode. By default, silent mode uses absolute XPaths to traverse to elements, but by using XPath Templates, you can add relative XPaths which will by dynamically used by the algorithm to generate relative XPaths for you. Here’s how it works:

Example:

  1. Relative XPath is captured using Interactive Mode: //a[contains(text(),'LOGIN')]

  2. XPath Template is created which contains the XPath: //a[contains(text(),'$LABEL')]

  3. User starts recorder with Silent Mode and clicks on an element to capture it:

    1. If the XPath in the template works with this element, a step is created with the relative XPath

    2. If the XPath in the template does not work with this element, a step is created with the absolute XPath. For example /html[1]/body[1]/div[1]/div[1]/div[1]/div[3]/div[2]/a[2]

XPaths can be separated by creating several XPath Templates and adding different descriptions for them, but generally the recorder will use all available XPaths from all templates to match your case and if no match is found, an absolute XPath will be used.

...

The following scenario will show you how you can practice XPath Templates:

  1. Start a new test case and navigate to the website https://reference.subject-7.com

  2. While Silent Mode is active, click Capture on the platform

    Image Modified
  3. Click Login link on the page

    Image Modified
  4. A new step with Click command will be added on the platform. Notice that the XPath is absolute.

    Image Modified
  5. Switch to Interactive Mode and record the same link one more time

  6. A new step with Click command will be added on the platform. Notice that the XPath is now relative

    Image Modified
  7. Stop the recorder by clicking Stop Recording on the platform

  8. Copy the relative XPath from your step and go to

...

  1. Repository > XPath Templates on the platform

  2. Create a new XPath Template and replace LOGIN with $LABEL. Save the XPath Template and close it

    Image Modified
  3. Switch back to Silent Mode and Start the recorder. Now capture the element one last time

  4. Your new step will now use a relative XPath which was used from your XPath Template

    Image Modified