Anton is the TestFirst AI Assistant. You can use Anton's help to write test cases and improve selectors. When writing a request to Anton, you can use plain language.
Currently, Anton is only capable of suggesting scenarios for the browser tests. Refer to the Gherkin spec for the sentences for other drivers. |
Writing tests
An example of the request is shown in Anton's panel:
Write an automated test that visits testfirst.com and clicks on SIGN IN.
Then "Forgot password?" is displayed.
As you can see in the example, the request should start with what you want Anton to do:
Write an automated test
Then, describe the action you want to be taken:
visit testfirst.com and click on SIGN IN.
After that, describe what the end result should be:
Then "Forgot password?" is displayed.
When you've finished typing the request, simply send the request. In response, Anton will propose a scenario for your test. You can copy it and paste into the text pane and edit it if necessary.
Anton's response can vary insignificantly between requests. |
Improving selectors
Amton can help you improve selectors. For instance, you can copy the xPath of an element in the Elements tab when you inspect an element, then paste it into Anton's textbox with some additional information, for instance, the text content of the element, and Anton will suggest a better selector.
For instance, if we wanted to get a selector for the link to the "Data Repository" article in the sidebar on this page, this is what the standard copying of xPath generates: //*[@id="article-container"]/aside/div/div/ul/li[4]/a
. We can improve on that by sending this request to Anton:
Shorten xpath selector //*[@id="article-container"]/aside/div/div/ul/li[4]/a.
The text on the element is "Data Repository".
Anton will respond with this selector:
//a[text()="Data Repository"]
If Anton doesn't satisfy your needs on the first try, you can ask it to further improve the selector, or tell it that the selector it provided doesn't work. It will try to correct the mistake or further improve the selector. |
Comments
0 comments
Please sign in to leave a comment.