Accessor Functions
Assert functions will always trigger a failure if they do not succeed. Verify Functions described above, unlike Assert functions, can be configure not to fail the script execution using the setAssertType function.
_byClassName = byClassName
Parameters: value
Description: Finds an element by class name with given tag name and constrained by given relations
Example:
<div class="bigfont">Some text</div>
_byClassName("bigfont", "DIV")
_byCss = byCss
Parameters: value
Description: This returns the element matching with the specified css
Example:
_navigateTo("http://sahitest.com/");_click(_link("demo"));_click(_byCss("a.a.x"));_click(_link("Back"));
_byId = byId
Parameters: value
Description: This returns the element matching with the specified id
Example 1:
<div id="s2id_autogen2">Add Member</div>
_byId("s2id_autogen2") // points to the above tag. Note that the tagName "div" is not used here.
Example 2:
_navigateTo("http://sahitest.com/demo/linkTest.htm");_click(_byCss("myLink"));
_byName = byName
Parameters: value
Description: Finds the element with the name of the element. If more than one match, this returns the first matching element.
Example:
navigateTo("http://sahitest.com/");click(link("demo"));click(link("Form Test"));var t1 = byName("t1");
_byJQuery = byJQuery
Parameters: value
Description: Returns the first match based on the input string. Input can be any of jQuery selectors
Example:
byJQuery("#s1Id"); // id selector since u can see # in itbyJQuery("input"); // returns the first match input elementbyJQuery(".ac-content"); // returns the first match of element class selector
_bySelenium = bySelenium
Parameters: value
Description: uses selenium locator to get the element
Example:
_navigateTo("http://sahitest.com/demo/");_click(_bySelenium("css=a.a.x"));_click(_link("Back"));
_byTagName = byTagName
Parameters: value
Description: Finds the element with the tag name of the element. If more than one match, this returns the first matching element.
Example:
navigateTo("http://sahitest.com/");click(link("demo"));click(link("Form Test"));var text = byTagName("input");
_byXPath = byXPath
Parameters: value
Description: This returns the element matching with the specified XPath
Example:
navigateTo("http://demosite.appvance.com/");click(byXPath('//*[@class="list-group-item"]'));click(byXPath('//*[@class="list-group-item"]'));