How to use
Multiple ways to use Ruto
chronicle test sequence
1. Click on the record icon
2. Click on the elements to generate XPath
3. Once elements are selected turn off recording by click on the same button
4. New text file will be downloaded and opened where you can find code snippets.
1. Single element
Right-click on the element and click "Add to Ruto" from the Ruto - XPath Finder, This is enough to get XPath, Which will be shown in the Ruto page.
You can access it by using the shortcut ALT + R (r) Keys.
2. Parent and child based element
At times we want XPath based on parent and child (Following and Preceding)
In that case, Right-click on the parent (source) element by clicking on the "Select Source", then right-click on the child (target) and click "Select Target".
By default, it combined the XPath and give you, In case if you don't like the pattern and you want to customize then play with available options within the Ruto Page.
Snippets
Basic snippets
It's pretty much easy to get snippets from Ruto.
Ruto understands the element type and based on that it suggest the code snippet.
For instance, Here we are dealing with a text box, where most of the time we used to either type (sendKeys) or getAttribute.
Type - select to use the sendKeys code snippet
Attribute - select to use the getAttribute code snippet
It also suggest you to pick the attribute value as well
Advance snippets (Page Object Model)
Click on the Setting icon in the Ruto page to configure the POM snippets
Click on POM option to enable the POM Snippets
Based on your framework - type and save method names
Right click on the element to get XPath and use the snippet option to get POM code, It's easy and fun