PHP Class Nearsoft\SeleniumClient\WebElement

Afficher le fichier Open project: nearsoft/php-selenium-client

Méthodes publiques

Méthode Description
__call ( string $name, array $args ) : mixed Enables setAttribute and getAttribute methods be invoked through method missing.
__construct ( WebDriver $driver, $elementId )
addClass ( string $class )
clear ( ) Clear current element's text
click ( ) Click on element
compareToOther ( WebElement $webElementCompare ) : boolean Test if two element refer to the same DOM element.
describe ( ) : Array Gets element's description
findElement ( By $locator, boolean $polling = false ) : Nearsoft\SeleniumClient\WebElement Find element within current element
findElements ( By $locator, boolean $polling = false ) : Nearsoft\SeleniumClient\WebElement[] Find elements within current element
getAttribute ( String $attributeName ) : String Gets element's specified attribute's value
getCSSProperty ( string $propertyName ) : String Gets element's property CSS
getCoordinates ( ) : Array Get element's coordinates
getElementId ( ) : integer Gets element's id
getElementSize ( ) : array Gets an element's size in pixels
getLocationOnScreenOnceScrolledIntoView ( ) : Array Get element's coordinates after scrolling
getTagName ( ) : String Gets element's tag name
getText ( ) : String Gets element's visible text
hasClass ( string $class )
isDisplayed ( ) : boolean Gets whether element is displayed
isEnabled ( ) : boolean Gets whether element is enabled
isSelected ( ) : boolean Gets whether element is selected
removeClass ( string $class )
sendKeys ( String $text ) Send text to element
setAttribute ( string $attributeName, string $value ) Sets element's specified attribute's value
submit ( ) Submit form from element
waitForElementUntilIsDisplayed ( integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement Wait for current element to be displayed
waitForElementUntilIsEnabled ( integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement Wait for current element to be enabled
waitForElementUntilIsPresent ( By $locator, integer $timeOutSeconds = 5 ) : mixed Wait for expected element to be present within current element
waitForElementUntilIsPresentWithSpecificText ( By $locator, String $targetText, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement Wait until current element's text equals specified
waitForElementUntilTextIsChanged ( String $targetText, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement Wait until current element's text has changed

Private Methods

Méthode Description
getCharArray ( String $text ) : array Returns array of chars from String

Method Details

__call() public méthode

The methods should be invoked with the format 'set/get'. Arguments should match those required by setAttribute and getAttribute methods. i.e. setClassName, getInnerHTML, getClassName
public __call ( string $name, array $args ) : mixed
$name string
$args array
Résultat mixed

__construct() public méthode

public __construct ( WebDriver $driver, $elementId )
$driver WebDriver

addClass() public méthode

public addClass ( string $class )
$class string

clear() public méthode

Clear current element's text
public clear ( )

click() public méthode

Click on element
public click ( )

compareToOther() public méthode

Test if two element refer to the same DOM element.
public compareToOther ( WebElement $webElementCompare ) : boolean
$webElementCompare WebElement
Résultat boolean

describe() public méthode

Gets element's description
public describe ( ) : Array
Résultat Array

findElement() public méthode

Find element within current element
public findElement ( By $locator, boolean $polling = false ) : Nearsoft\SeleniumClient\WebElement
$locator By
$polling boolean
Résultat Nearsoft\SeleniumClient\WebElement

findElements() public méthode

Find elements within current element
public findElements ( By $locator, boolean $polling = false ) : Nearsoft\SeleniumClient\WebElement[]
$locator By
$polling boolean
Résultat Nearsoft\SeleniumClient\WebElement[]

getAttribute() public méthode

Gets element's specified attribute's value
public getAttribute ( String $attributeName ) : String
$attributeName String
Résultat String

getCSSProperty() public méthode

Gets element's property CSS
public getCSSProperty ( string $propertyName ) : String
$propertyName string
Résultat String

getCoordinates() public méthode

Get element's coordinates
public getCoordinates ( ) : Array
Résultat Array

getElementId() public méthode

Gets element's id
public getElementId ( ) : integer
Résultat integer

getElementSize() public méthode

Gets an element's size in pixels
public getElementSize ( ) : array
Résultat array

getLocationOnScreenOnceScrolledIntoView() public méthode

Get element's coordinates after scrolling
public getLocationOnScreenOnceScrolledIntoView ( ) : Array
Résultat Array

getTagName() public méthode

Gets element's tag name
public getTagName ( ) : String
Résultat String

getText() public méthode

Gets element's visible text
public getText ( ) : String
Résultat String

hasClass() public méthode

public hasClass ( string $class )
$class string

isDisplayed() public méthode

Gets whether element is displayed
public isDisplayed ( ) : boolean
Résultat boolean

isEnabled() public méthode

Gets whether element is enabled
public isEnabled ( ) : boolean
Résultat boolean

isSelected() public méthode

Gets whether element is selected
public isSelected ( ) : boolean
Résultat boolean

removeClass() public méthode

public removeClass ( string $class )
$class string

sendKeys() public méthode

Send text to element
public sendKeys ( String $text )
$text String

setAttribute() public méthode

Sets element's specified attribute's value
public setAttribute ( string $attributeName, string $value )
$attributeName string The element's attribute name
$value string The value to set the attribute

submit() public méthode

Submit form from element
public submit ( )

waitForElementUntilIsDisplayed() public méthode

Wait for current element to be displayed
public waitForElementUntilIsDisplayed ( integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$timeOutSeconds integer
Résultat Nearsoft\SeleniumClient\WebElement

waitForElementUntilIsEnabled() public méthode

Wait for current element to be enabled
public waitForElementUntilIsEnabled ( integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$timeOutSeconds integer
Résultat Nearsoft\SeleniumClient\WebElement

waitForElementUntilIsPresent() public méthode

Wait for expected element to be present within current element
public waitForElementUntilIsPresent ( By $locator, integer $timeOutSeconds = 5 ) : mixed
$locator By
$timeOutSeconds integer
Résultat mixed

waitForElementUntilIsPresentWithSpecificText() public méthode

Wait until current element's text equals specified
public waitForElementUntilIsPresentWithSpecificText ( By $locator, String $targetText, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$locator By
$targetText String
$timeOutSeconds integer
Résultat Nearsoft\SeleniumClient\WebElement

waitForElementUntilTextIsChanged() public méthode

Wait until current element's text has changed
public waitForElementUntilTextIsChanged ( String $targetText, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$targetText String
$timeOutSeconds integer
Résultat Nearsoft\SeleniumClient\WebElement