The following functions are intended to handle timing on test automation.
While it is not recommended to use PauseFor (sleep time) on tests, sometimes it could be handy in troubleshooting.
![image_201812716535_1_png](/commwiki/apgetwikiimage?41639,1)
Pauses (sleep) during test execution.
Parameters:
- seconds: the number of seconds to wait for.
Example of use:
&driver.PauseFor(3)
![image_20181271664_1_png](/commwiki/apgetwikiimage?41640,1)
Waits (explicitly) for a ceirtain HTML element to be present (or visible) on the webpage.
Parameters:
- ID: the HTML element ID to wait for.
- Visible: When true, it also checks for an element to be visible.
Example of use:
&driver.WaitById("button1", true)
![image_201812716711_1_png](/commwiki/apgetwikiimage?41641,1)
Waits (explicitly) for a link to be present (or visible) on the webpage.
Parameters:
- LinkText: the link text to wait for.
- Visible: When true, it also checks for an element to be visible.
Example of use:
&driver.WaitByLinkText("click here", true)
![image_201812716744_1_png](/commwiki/apgetwikiimage?41642,1)
Waits (explicitly) for a ceirtain HTML element to be present (or visible) on the webpage using the element Name.
Parameters:
- Name: the HTML element NAME to wait for.
- Visible: When true, it also checks for an element to be visible.
Example of use:
&driver.WaitByName("LinksContainer", true)
![image_201812716639_1_png](/commwiki/apgetwikiimage?41643,1)
Waits (explicitly) for a ceirtain HTML element to be present (or visible) on the webpage using the CSS selector.
Parameters:
- CSS: the CSS selector to the element that wants to wait for.
- Visible: When true, it also checks for an element to be visible.
Example of use:
&driver.WaitByCSS("#button1", true)
![image_201812716810_1_png](/commwiki/apgetwikiimage?41644,1)
Waits (explicitly) for a certain HTML element to be present (or visible) on the webpage using the XPath selector.
Parameters:
- XPath: the XPath selector to the element that wants to wait for.
- Visible: When true, it also checks for an element to be visible.
Example of use:
&driver.WaitByXPath("//span/input", true)