function Container::parseArgs
Parse arguments allowing either separate $using and $value parameters, or as an array containing the JSON parameters
Parameters
string $method method name:
array $argv arguments:
Return value
array
Throws
\WebDriver\Exception if invalid number of arguments to the called method
2 calls to Container::parseArgs()
- Container::element in vendor/
lullabot/ php-webdriver/ lib/ WebDriver/ Container.php - Find element: /session/:sessionId/element (POST) Find child element: /session/:sessionId/element/:id/element (POST) Search for element on page, starting from the document root.
- Container::elements in vendor/
lullabot/ php-webdriver/ lib/ WebDriver/ Container.php - Find elements: /session/:sessionId/elements (POST) Find child elements: /session/:sessionId/element/:id/elements (POST) Search for multiple elements on page, starting from the document root.
File
-
vendor/
lullabot/ php-webdriver/ lib/ WebDriver/ Container.php, line 136
Class
- Container
- Abstract WebDriver\Container class
Namespace
WebDriverCode
private function parseArgs($method, $argv) {
$argc = count($argv);
switch ($argc) {
case 2:
$using = $argv[0];
$value = $argv[1];
break;
case 1:
$arg = $argv[0];
if (is_array($arg)) {
$using = $arg['using'];
$value = $arg['value'];
break;
}
// fall through
default:
throw WebDriverException::factory(WebDriverException::JSON_PARAMETERS_EXPECTED, sprintf('Invalid arguments to %s method: %s', $method, print_r($argv, true)));
}
return $this->locate($using, $value);
}