Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom commands

Ondřej Machulda edited this pageApr 16, 2021 ·4 revisions

Since version 1.8.0, php-webdriver allows sending custom commands to the remote end.

This is useful for eg. vendor-specific commands, which are not part of theW3C WebDriver standard and are only available in specific browsers, or for commands which were not yet implemented in this library.

$driver = RemoteWebDriver::create($host,$capabilities);// Execute Mozilla vendor-specific print command$driver->executeCustomCommand('/session/:sessionId/moz/print/','POST');// Execute Mozilla vendor-specific full-page screenshot command$screenshot =$driver->executeCustomCommand('/session/:sessionId/moz/screenshot/full/','POST');file_put_contents('full.png',base64_decode($screenshot));// Execute Appium command to get content of the system clipboard$clipboard =$driver->executeCustomCommand('/session/:sessionId/appium/device/get_clipboard/','POST');// Execute ChromeDevTools protocol command$result =$driver->executeCustomCommand('/session/:sessionId/goog/cdp/execute','POST',    ['cmd' =>'Runtime.evaluate','params' => ['expression' =>'window.location.toString()']]);

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp