PHP 클래스 Nearsoft\SeleniumClient\WebDriver

파일 보기 프로젝트 열기: nearsoft/php-selenium-client 1 사용 예제들

공개 메소드들

메소드 설명
__call ( string $name, array $args ) : mixed Enables Navigation's methods be invoked as navigationNameMethod Example: navigationRefresh, navigationBack.
__construct ( DesiredCapabilities $desiredCapabilities = null, String $host = "http://localhost", integer $port = 4444 )
addCookie ( $name, $value, null $path = null, null $domain = null, null $secure = null, null $expiry = null ) Delegated addCookies to Class Options
close ( ) Closes current window
deleteAllCookies ( ) Delegated method deleteAllCookies to Class Options
deleteCookieNamed ( $cookieName ) Delegated method deleteCookieName to Class Options
executeAsyncScript ( String $script, Array $args = null ) : String Execute async javascript on page
executeScript ( String $script, Array $args = null ) : String Executes javascript on page
findElement ( By $locator, boolean $polling = false, integer $elementId ) : Nearsoft\SeleniumClient\WebElement Gets an element within current page
findElements ( By $locator, boolean $polling = false, integer $elementId ) : Nearsoft\SeleniumClient\WebElement[] Gets elements within current page
get ( String $url ) Navigates to specified url
getCapabilities ( ) : Array Gets actual capabilities
getCookieNamed ( $cookieName ) Delegated method getCookieNamed to Class Options
getCookies ( ) : Array Delegated getCookies to Class Options
getCurrentSessions ( ) : Array Gets information on current selenium sessions
getCurrentUrl ( ) : String Gets current url
getEnvironment ( ) : String Get current Selenium environment
getHttpClient ( ) : String Get HttpClient Object
getHubUrl ( ) : String Get current Selenium Hub url
getPageSource ( ) : String Gets current page source
getScreenShotsDirectory ( ) : String Get default screenshots directory
getSessionId ( ) : integer Get assigned session id
getTitle ( ) : String Gets current page title
getWindowHandle ( ) : String Gets current window's identifier
getWindowHandles ( ) : Array Gets a list of available windows in current session
manage ( ) : Nearsoft\SeleniumClient\Options Gets Options object
navigate ( ) : Nearsoft\Selenium\Navigation Get Navigation object
quit ( ) Removes current session
screenshot ( String $overrideScreenshotsDirectory = null ) : string Takes screenshot of current screen, saves it in specified default directory or as specified in parameter
setEnvironment ( String $value ) Set whether production or testing mode for library
setNavigate ( $navigate ) Set Navigation
setScreenShotsDirectory ( String $value ) Sets default screenshots directory for files to be stored in
setSwitchTo ( $targetLocator ) Set Target Locator
status ( ) : Array Get current server's status
switchTo ( ) : Nearsoft\SeleniumClient\TargetLocator Creates new target locator to be handled
waitForElementUntilIsNotPresent ( By $locator, integer $timeOutSeconds = 5 ) : boolean Stops the process until an element is not found
waitForElementUntilIsPresent ( By $locator, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement Stops the process until an element is found

비공개 메소드들

메소드 설명
callFindElement ( $name, array $args ) Call findElement and findElement methods
callNavigationMethods ( $name, $args ) Call Navigation Methods
callSwitchTo ( $name, array $args ) : mixed Call Target Locator Methods
callWindowMethods ( $name, $args ) : array Call Navigation Methods
executeScriptInternal ( String $script, boolean $async, Array $args ) : String Executes javascript on page
startSession ( DesiredCapabilities $desiredCapabilities ) Starts new Selenium session

메소드 상세

__call() 공개 메소드

Enables window's methods be invoked Example: windowMaximize, windowGetPosition. Enables TargetLocator's methods Examples: switchToWindow, switchToFrame Enables findElement and findElements methods be invoked through method missing. The methods should be invoked with the format 'findElementBy'. Arguments should match those required by findElement and findElements methods. i.e. findElementByCssSelector, findElementByTagName, findElementsByXPath
public __call ( string $name, array $args ) : mixed
$name string
$args array
리턴 mixed

__construct() 공개 메소드

public __construct ( DesiredCapabilities $desiredCapabilities = null, String $host = "http://localhost", integer $port = 4444 )
$desiredCapabilities DesiredCapabilities
$host String
$port integer

addCookie() 공개 메소드

Delegated addCookies to Class Options
public addCookie ( $name, $value, null $path = null, null $domain = null, null $secure = null, null $expiry = null )
$name
$value
$path null
$domain null
$secure null
$expiry null

close() 공개 메소드

Closes current window
public close ( )

deleteAllCookies() 공개 메소드

Delegated method deleteAllCookies to Class Options
public deleteAllCookies ( )

deleteCookieNamed() 공개 메소드

Delegated method deleteCookieName to Class Options
public deleteCookieNamed ( $cookieName )
$cookieName

executeAsyncScript() 공개 메소드

Execute async javascript on page
public executeAsyncScript ( String $script, Array $args = null ) : String
$script String
$args Array
리턴 String

executeScript() 공개 메소드

Executes javascript on page
public executeScript ( String $script, Array $args = null ) : String
$script String
$args Array
리턴 String

findElement() 공개 메소드

Gets an element within current page
public findElement ( By $locator, boolean $polling = false, integer $elementId ) : Nearsoft\SeleniumClient\WebElement
$locator By
$polling boolean
$elementId integer
리턴 Nearsoft\SeleniumClient\WebElement

findElements() 공개 메소드

Gets elements within current page
public findElements ( By $locator, boolean $polling = false, integer $elementId ) : Nearsoft\SeleniumClient\WebElement[]
$locator By
$polling boolean
$elementId integer
리턴 Nearsoft\SeleniumClient\WebElement[]

get() 공개 메소드

Navigates to specified url
public get ( String $url )
$url String

getCapabilities() 공개 메소드

Gets actual capabilities
public getCapabilities ( ) : Array
리턴 Array of actual capabilities

getCookieNamed() 공개 메소드

Delegated method getCookieNamed to Class Options
public getCookieNamed ( $cookieName )
$cookieName

getCookies() 공개 메소드

Delegated getCookies to Class Options
public getCookies ( ) : Array
리턴 Array

getCurrentSessions() 공개 메소드

Gets information on current selenium sessions
public getCurrentSessions ( ) : Array
리턴 Array of current sessions in hub

getCurrentUrl() 공개 메소드

Gets current url
public getCurrentUrl ( ) : String
리턴 String

getEnvironment() 공개 메소드

Get current Selenium environment
public getEnvironment ( ) : String
리턴 String

getHttpClient() 공개 메소드

Get HttpClient Object
public getHttpClient ( ) : String
리턴 String

getHubUrl() 공개 메소드

Get current Selenium Hub url
public getHubUrl ( ) : String
리턴 String

getPageSource() 공개 메소드

Gets current page source
public getPageSource ( ) : String
리턴 String

getScreenShotsDirectory() 공개 메소드

Get default screenshots directory
public getScreenShotsDirectory ( ) : String
리턴 String

getSessionId() 공개 메소드

Get assigned session id
public getSessionId ( ) : integer
리턴 integer

getTitle() 공개 메소드

Gets current page title
public getTitle ( ) : String
리턴 String

getWindowHandle() 공개 메소드

Gets current window's identifier
public getWindowHandle ( ) : String
리턴 String

getWindowHandles() 공개 메소드

Gets a list of available windows in current session
public getWindowHandles ( ) : Array
리턴 Array

manage() 공개 메소드

Gets Options object
public manage ( ) : Nearsoft\SeleniumClient\Options
리턴 Nearsoft\SeleniumClient\Options

navigate() 공개 메소드

Get Navigation object
public navigate ( ) : Nearsoft\Selenium\Navigation
리턴 Nearsoft\Selenium\Navigation

quit() 공개 메소드

Removes current session
public quit ( )

screenshot() 공개 메소드

Takes screenshot of current screen, saves it in specified default directory or as specified in parameter
public screenshot ( String $overrideScreenshotsDirectory = null ) : string
$overrideScreenshotsDirectory String
리턴 string

setEnvironment() 공개 메소드

Set whether production or testing mode for library
public setEnvironment ( String $value )
$value String

setNavigate() 공개 메소드

Set Navigation
public setNavigate ( $navigate )
$navigate

setScreenShotsDirectory() 공개 메소드

Sets default screenshots directory for files to be stored in
public setScreenShotsDirectory ( String $value )
$value String

setSwitchTo() 공개 메소드

Set Target Locator
public setSwitchTo ( $targetLocator )
$targetLocator

status() 공개 메소드

Get current server's status
public status ( ) : Array
리턴 Array

switchTo() 공개 메소드

Creates new target locator to be handled
public switchTo ( ) : Nearsoft\SeleniumClient\TargetLocator
리턴 Nearsoft\SeleniumClient\TargetLocator

waitForElementUntilIsNotPresent() 공개 메소드

Stops the process until an element is not found
public waitForElementUntilIsNotPresent ( By $locator, integer $timeOutSeconds = 5 ) : boolean
$locator By
$timeOutSeconds integer
리턴 boolean true when element is gone, false if element is still there

waitForElementUntilIsPresent() 공개 메소드

Stops the process until an element is found
public waitForElementUntilIsPresent ( By $locator, integer $timeOutSeconds = 5 ) : Nearsoft\SeleniumClient\WebElement
$locator By
$timeOutSeconds integer
리턴 Nearsoft\SeleniumClient\WebElement