1.0.2
Scrolls to top of the webpage.
nemo.util.scrollToTop()
Scrolls to bottom of the webpage.
nemo.util.scrollToBottom()
Maximize browser window.
nemo.util.maximizeWindow()
Scrolls to particular web element provided as the input.
(WebElement)
nemo.util.scrollInToView()
Waits till the webpage completes loading Javascript.
(number
= 30000
)
Timeout in milliseconds. Defaults to 30 seconds.
await nemo.util.waitForJSReady(45 * 1000)
Hovers on the web element provided.
(WebElement)
Web element.
let element = await nemo.view._find('.result')
await nemo.util.hoverOn(element)
Hovers and clicks on the web element provided.
(WebElement)
Web element.
let element = await nemo.view._find('.result')
await nemo.util.hoverAndClick(element)
Double click on the web element provided.
(WebElement)
Web element.
let element = await nemo.view._find('.result')
await nemo.util.doubleClick(element)
Right/Context click on the web element provided.
(WebElement)
Web element.
let element = await nemo.view._find('.result')
await nemo.util.rightClick(element)
Clicks on the web element using Javascript. Useful at places where selenium click doesn't works.
(WebElement)
Web element.
let element = await nemo.view._find('.result')
await nemo.util.javascriptClick(element)
Clears value of Input
tag element.
(string)
ID of the web element.
<input id='car' value='testla'></input>
await nemo.util.clearInputValue('car')
Returns value of Input
tag element.
(string)
ID of the web element.
<input id='car' value='testla'></input>
let value = await nemo.util.getInputValue('car') // value = 'tesla'
Sets value of Input
tag element.
<input id='car' value='testla'></input>
await nemo.util.setInputValue('car', 'Honda')
Checks if a Checkbox
element is checked.
(WebElement)
Web element.
boolean
:
let element = await nemo.view._find('.result')
let flag = await nemo.util.isChecked(element)
Returns the Inner Text
of the web element.
(WebElement)
Web element.
string
:
let element = await nemo.view._find('.result')
let data = await nemo.util.getInnerText(element)
Verify if the image web element is loaded & displayed to user.
(WebElement)
Image web element.
(number
= 30000
)
Timeout in milliseconds. Defaults to 30 seconds.
Promise<boolean>
:
let element = await nemo.view._find('.img')
let flag = await nemo.util.isImageLoaded(element)
or
let flag = await nemo.util.isImageLoaded(element, 45 * 1000)
Returns a list of all the anchor
tag elements.
List<WebElement>
:
let list = await nemo.util.getAllLinkElements()
Returns elements whose visible text matches the given string.
(string)
Visible text of the link displayed.
Promise<WebElement>
:
let element = await nemo.util.getElementWithLinkText('Elon Musk')
Clicks on element whose visible text matches the given string.
(string)
Visible text of the link displayed.
let element = await nemo.util.clickElementWithLinkText('Elon Musk')
Waits till an alert shows up on the webpage.
await nemo.util.waitTillAlertDisplayed()
Accepts the alert displayed on the webpage.
await nemo.util.acceptAlert()
Dismiss the alert displayed on the webpage.
await nemo.util.dismissAlert()