1<?php 2 3namespace Facebook\WebDriver\Interactions\Internal; 4 5use Facebook\WebDriver\Internal\WebDriverLocatable; 6use Facebook\WebDriver\WebDriverAction; 7use Facebook\WebDriver\WebDriverKeyboard; 8use Facebook\WebDriver\WebDriverMouse; 9 10class WebDriverSendKeysAction extends WebDriverKeysRelatedAction implements WebDriverAction 11{ 12 /** 13 * @var string 14 */ 15 private $keys = ''; 16 17 /** 18 * @param WebDriverKeyboard $keyboard 19 * @param WebDriverMouse $mouse 20 * @param WebDriverLocatable $location_provider 21 * @param string $keys 22 */ 23 public function __construct( 24 WebDriverKeyboard $keyboard, 25 WebDriverMouse $mouse, 26 WebDriverLocatable $location_provider = null, 27 $keys = '' 28 ) { 29 parent::__construct($keyboard, $mouse, $location_provider); 30 $this->keys = $keys; 31 } 32 33 public function perform() 34 { 35 $this->focusOnElement(); 36 $this->keyboard->sendKeys($this->keys); 37 } 38} 39