Targeting Elements
1 - Matching by text
This matches by using either the text on screen, or aria labels. For example I.click("login") or I.fill("First Name","John")
One thing useful is that when there are multiple text of the same text, it is sometimes useful to do an I.see("Unique text") near the target text to interact with, think of it as instructing a user over the phone 😉
2 - Matching by HTML/CSS class name
Elements can be selected using HTML/CSS class name, with a dot prefix. For example I.clPopularHandling a DATE PICKER
Date pickers may or will vary from each website, the complexity of the date picker is based on how the calendar or the date picker of website has been designed. Some are may be as simple as typing in the dates by using the I.fill or I.type.
So this guide will help the user or at least give an idea on how to handle the date picker should the user encounter a simple or complex one.
Without further ado let's get to the step by step procedure
Fill Date Picker using text input commands
StePopularTesting a website with standard HTTP auth prompts
For websites with HTTP authentication prompts, such as the following
You will need to provide the username and password, while loading the page URL. Such as the following instead.
Note that it is important, to get the "http" or "https" part of the URL correct, as the authentication details will be lost on any auto redirect.Few readersHow to Change Error Timeout threshold
Uilicious has a default timeout threshold of 15 seconds for each command, just in any case that the website might take more time in loading assets, you can change the timeout threshold this by using the command "TEST.commandTimeout()"
Sample:
With this command your timoute threshold will be increased to 30 seconds per commandFew readers