Div

The Div class provides a clean interface for interacting with generic container elements such as <div> blocks. It includes methods for selection, assertions, and scrolling into view.

Usage : div

🧩 Code

The Divc class is designed to interact with common div element

To insert a code block with syntax highlighting:

oi.ui.div(this.div_element).click()

Methods

click(): void Simulates a click on the div element.

  • @returns void

oi.ui.div(this.element).click()

forceClick(): void Forces a click on the div element, bypassing any potential blockers.

  • @returns void

oi.ui.div(this.element).forceClick()

doubleClick(forceClick: boolean): void Simulates a double-click on the div element.

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).doubleClick(true)

rightClick(): void Simulates a right-click on the div element.

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).rightClick(true)

clickDivWithCoordinates(x: number, y: number,forceClick:boolean): void Simulates a click on the div element at the specified coordinates.

  • @param {x} – The x-coordinate for the click.

  • @param {y} – The y-coordinate for the click.

  • @param {force} – { force: true } optional

  • @returns void

oi.ui.div(this.element).clickDivWithCoordinates(1,2,true)

centerClick(forceClick: boolean): void Simulates a click on the center of the div element.

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).centerClick(true)

multiElementClick(forceClick: boolean): void Simulates a click on multiple div elements.

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).multiElementClick(true)

firstElementClick(forceClick: boolean): void Simulates a click on the first div element in a collection.

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).firstElementClick(true)

lastElementClick(forceClick: boolean): void Simulates a click on the last div element in a collection

  • @param {force} – true (optional)

  • @returns void

oi.ui.div(this.element).lastElementClick(true)

getDivText(): void Retrieves the text content of the div element.

  • @returns void

oi.ui.div(this.element).getDivText()

Assertions

isEnabled(): void Asserts that the div element is enabled

  • @returns trueif the div is enable, otherwise false.

oi.ui.div(this.element).isEnabled()

isDisabled(): void Asserts that the div element is disabled

  • @returns trueif the div is enable, otherwise false.

oi.ui.div(this.element).isDisabled()

isDisplayed(): void Asserts that the div element is displayed

  • @returns trueif the div is enable, otherwise false.

oi.ui.div(this.element).isDisplayed()

isFocused(): void Asserts that the div element is focused

  • @returns trueif the div is enable, otherwise false.

oi.ui.div(this.element).isFocused()

assertDivIsVisible(): boolean Asserts that the div element is visible.

  • @returns trueif the div is visible, otherwise false.

oi.ui.div(this.element).asseertDivIsVisible()

assertDivIsNotVisible(): boolean Asserts that the div element is not visible.

  • @returns trueif the div is visible, otherwise false.

oi.ui.div(this.element).assertDivIsNotVisible()

assertDivIsEmpty(): boolean Asserts that the div element is empty.

  • @returns trueif the div is visible, otherwise false.

oi.ui.div(this.element).assertDivIsEmpty()

Scrolling

scrollUntill(): void Scrolls until the div element is in view.

  • @returns void

oi.ui.div(this.element).scrollUntill()

Last updated