|
Anton, the TestFirst AI Assistant, can help you with automating browser-based tests. Read this article to find out how to use it. |
|
You can hit CTRL+SPACE to trigger the auto-completer anywhere in the sentence to help you with writing the test case. |
In order to automate a browser-based test case, in the TF Automate text pane:
- Type in the Scenario: keyword followed by the step title. Ex.:
Scenario: Visit the main page.
Hit Enter.
- Start the first step with the
Given browser "<Browser>"
sentence that defines which browser to use, for instance: Given browser "Chrome"
. Hit Enter.
|
Currently, TF Automate only supports Chrome. |
- Write the rest of the step using TestFirst Gherkin specification. Below you can find the most common sentences you can use for the action and the expected result part of the step:
- Action:
- When I visit "<URL>"
- When I click "<Selector>"
- When I hover on "<Selector>"
- When I type "<Text>" in "<Selector>"
- Expected result:
- Then "<Selector>" is displayed
- Then "<Selector>" is not displayed
- Run the test as described in this article and make sure it runs successfully.
- Save the test by clicking the Save icon above the text pane.
- Publish the test by clicking on the Publish icon (checkmark) above the text pane to change the automation status of the test case to Automated (read more on statuses here).
|
Within the same step indicated by the Scenario keyword, you can only use When and Then sentences once. Any further action or expected result should be started with the And keyword.
Ex.:
Scenario: Verify the SIGN IN and START NOW buttons are displayed on the Pricing page Given browser "Chrome" When I visit "https://www.testfirst.com/" And I click "Pricing" Then "Sign In" is displayed And "Start Now" is displayed
|
|
In TestFirst Automate, we have implemented smart selectors. That means that in general, you can use the text on an element as a selector. However, sometimes this might not work, and you will have to create a custom selector and add it to the Data Repository. Read this article for information on how to add selectors to the Data Repository and this one on how to use them in your tests. |
Comments
0 comments
Please sign in to leave a comment.