scrollToTop

Scrolls to top of the webpage.

scrollToTop()
Example
nemo.util.scrollToTop()

scrollToBottom

Scrolls to bottom of the webpage.

scrollToBottom()
Example
nemo.util.scrollToBottom()

maximizeWindow

Maximize browser window.

maximizeWindow()
Example
nemo.util.maximizeWindow()

scrollInToView

Scrolls to particular web element provided as the input.

scrollInToView(webElement: WebElement)
Parameters
webElement (WebElement)
Example
nemo.util.scrollInToView()

waitForJSReady

Waits till the webpage completes loading Javascript.

waitForJSReady(timeout: number)
Parameters
timeout (number = 30000) Timeout in milliseconds. Defaults to 30 seconds.
Example
await nemo.util.waitForJSReady(45 * 1000)

hoverOn

Hovers on the web element provided.

hoverOn(webElement: WebElement)
Parameters
webElement (WebElement) Web element.
Example
let element = await nemo.view._find('.result')
await nemo.util.hoverOn(element)

hoverAndClick

Hovers and clicks on the web element provided.

hoverAndClick(webElement: WebElement)
Parameters
webElement (WebElement) Web element.
Example
let element = await nemo.view._find('.result')
await nemo.util.hoverAndClick(element)

doubleClick

Double click on the web element provided.

doubleClick(webElement: WebElement)
Parameters
webElement (WebElement) Web element.
Example
let element = await nemo.view._find('.result')
await nemo.util.doubleClick(element)

rightClick

Right/Context click on the web element provided.

rightClick(webElement: WebElement)
Parameters
webElement (WebElement) Web element.
Example
let element = await nemo.view._find('.result')
await nemo.util.rightClick(element)

javascriptClick

Clicks on the web element using Javascript. Useful at places where selenium click doesn't works.

javascriptClick(webElement: WebElement)
Parameters
webElement (WebElement) Web element.
Example
let element = await nemo.view._find('.result')
await nemo.util.javascriptClick(element)

clearInputValue

Clears value of Input tag element.

clearInputValue(webElement_ID: string)
Parameters
webElement_ID (string) ID of the web element.
Example
<input id='car' value='testla'></input>
await nemo.util.clearInputValue('car')

getInputValue

Returns value of Input tag element.

getInputValue(webElement_ID: string)
Parameters
webElement_ID (string) ID of the web element.
Example
<input id='car' value='testla'></input>
let value = await nemo.util.getInputValue('car') // value = 'tesla'

setInputValue

Sets value of Input tag element.

setInputValue(webElement_ID: string, value: string)
Parameters
webElement_ID (string) ID of the web element.
value (string) Value to be updated.
Example
<input id='car' value='testla'></input>
await nemo.util.setInputValue('car', 'Honda')

isChecked

Checks if a Checkbox element is checked.

isChecked(webElement: WebElement): boolean
Parameters
webElement (WebElement) Web element.
Returns
boolean:
Example
let element = await nemo.view._find('.result')
let flag = await nemo.util.isChecked(element)

getInnerText

Returns the Inner Text of the web element.

getInnerText(webElement: WebElement): string
Parameters
webElement (WebElement) Web element.
Returns
string:
Example
let element = await nemo.view._find('.result')
let data = await nemo.util.getInnerText(element)

isImageLoaded

Verify if the image web element is loaded & displayed to user.

isImageLoaded(webElement: WebElement, timeout: number): Promise<boolean>
Parameters
webElement (WebElement) Image web element.
timeout (number = 30000) Timeout in milliseconds. Defaults to 30 seconds.
Returns
Promise<boolean>:
Example
let element = await nemo.view._find('.img')
let flag = await nemo.util.isImageLoaded(element)
or
let flag = await nemo.util.isImageLoaded(element, 45 * 1000)

getAllLinkElements

Returns a list of all the anchor tag elements.

getAllLinkElements(): List<WebElement>
Returns
List<WebElement>:
Example
let list = await nemo.util.getAllLinkElements()

getElementWithLinkText

Returns elements whose visible text matches the given string.

getElementWithLinkText(linkText: string): Promise<WebElement>
Parameters
linkText (string) Visible text of the link displayed.
Returns
Promise<WebElement>:
Example
let element = await nemo.util.getElementWithLinkText('Elon Musk')

clickElementWithLinkText

Clicks on element whose visible text matches the given string.

clickElementWithLinkText(linkText: string)
Parameters
linkText (string) Visible text of the link displayed.
Example
let element = await nemo.util.clickElementWithLinkText('Elon Musk')

waitTillAlertDisplayed

Waits till an alert shows up on the webpage.

waitTillAlertDisplayed()
Example
await nemo.util.waitTillAlertDisplayed()

acceptAlert

Accepts the alert displayed on the webpage.

acceptAlert()
Example
await nemo.util.acceptAlert()

dismissAlert

Dismiss the alert displayed on the webpage.

dismissAlert()
Example
await nemo.util.dismissAlert()