Nearsoft\SeleniumClient\DesiredCapabilities::setCapability PHP Метод

setCapability() публичный Метод

Sets specified capability
public setCapability ( String $capabilityType, String $value )
$capabilityType String
$value String
    public function setCapability($capabilityType, $value)
    {
        if ($this->isValidCapabilityAndValue($capabilityType, $value)) {
            $this->_capabilities[$capabilityType] = $value;
        }
    }

Usage Example

Пример #1
0
 public function setUp()
 {
     $this->_testUrl = "http://nearsoft-php-seleniumclient.herokuapp.com/sandbox/";
     $desiredCapabilities = new DesiredCapabilities();
     $desiredCapabilities->setCapability(CapabilityType::BROWSER_NAME, BrowserType::FIREFOX);
     $desiredCapabilities->setCapability(CapabilityType::VERSION, "24.0");
     $desiredCapabilities->setCapability(CapabilityType::PLATFORM, PlatformType::WINDOWS);
     $this->_driver = new WebDriver($desiredCapabilities);
     //note that the actual capabilities supported may be different to the desired capabilities specified
 }