Generic Accessor APIs
_activeElement
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
4.0 | NA | NA | NA | NA |
Available for modes: Browser
_activeElement()
Arguments
None |
Returns
HTML DOM element | Element in focus |
Sahi Pro Flowcharts Action :Active Element
Details
Used to verify if the specific element is the one in focus. Eg
Used to verify if the specific element is the one in focus. Eg
_assertEqual(_texbox("user"), _activeElement());
_byId
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_byId($id)
Arguments
$id | string | id of element |
Returns
HTML DOM element | Element matching with the specified id |
Sahi Pro Flowcharts Action :By Id
Details
Used to find elements solely by id without using its tagName information.
Used to find elements solely by id without using its tagName information.
<div id="errormsg">Error</div>
_byId("errormsg") // points to the above tag. Note that the tagName "div" is not used here.
_byText
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_byText($text, $tagName)
Arguments
$text | string | text of element |
$tagName | string | tagName of element which has this text. eg. "DIV" |
Returns
HTML DOM element | Element matching with the specified text and tagName |
Sahi Pro Flowcharts Action :By Text
Details
Used to find element by text and tagName
Used to find element by text and tagName
<div id="errormsg">some text</div>
_byText("some text", "DIV") // points to the above tag.
danger
DEPRECATED:
Use
_div("some text")
or more specifically _div({sahiText:"some text"})
instead
_byClassName
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_byClassName($className, $tagName[, $relations])
Arguments
$className | string | className of element |
$tagName | string | tagName of element which has this text. eg. "DIV" |
$relations | relation optional | DOM or Positional Relations |
Returns
HTML DOM element | Element matching with the specified className and tagName |
Sahi Pro Flowcharts Action :By Class Name
Details
Finds element by className with given tagName and constrained by given relations
Finds element by className with given tagName and constrained by given relations
<div class="bigfont">Some text</div>
_byClassName("bigfont", "DIV")
danger
DEPRECATED:
Use
_div("bigfont")
or more specifically _div({className:"bigfont"})
instead
_byXPath
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_byXPath($xpath)
Arguments
$xpath | string | XPath of element |
Returns
HTML DOM element | Element matching with the specified xpath |
Sahi Pro Flowcharts Action :By XPath
Details
Eg.
Eg.
_byXPath("//table[3]//tr[1]/td[2]")
_byXPath("//tr[1]/td[2]")
This is a convenience method for people moving from Selenium or other tools to Sahi.
info
XPaths are natively enabled on Firefox.
For browsers like Internet Explorer which do not have support for XPath use Javascript-XPath.
For browsers without XPath support, use Javascript-XPath Download the file from this link and save the file as
This file is under its own MIT license and is not part of Sahi's code base
For browsers without XPath support, use Javascript-XPath Download the file from this link and save the file as
sahi/htdocs/spr/ext/javascript-xpath/javascript-xpath.js
This file is under its own MIT license and is not part of Sahi's code base
_accessor
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_accessor($string)
Arguments
$string | string | String to eval |
Returns
HTML DOM element | Element |
Sahi Pro Flowcharts Action :Accessor
Details
This API just evaluates the string and returns a dom object. Eg.
This API just evaluates the string and returns a dom object. Eg.
_accessor("document.formName.elementName")
.
This API is not very useful.
_bySeleniumLocator
Since: | Sahi Pro | Desktop Add-On | Mobile Add-On | SAP Add-On | AI Assist Add-On |
3.5 | NA | NA | NA | NA |
Available for modes: Browser
_bySeleniumLocator($locator)
Arguments
$locator | string | selenium locator |
Returns
null |
Sahi Pro Flowcharts Action :By Selenium Locator
Details
Allows identification of elements using some Selenium locators. Use only while migrating from Selenium to Sahi.
Allows identification of elements using some Selenium locators. Use only while migrating from Selenium to Sahi.