3

我在这里使用 PHP 网络驱动程序绑定: http ://code.google.com/p/php-webdriver-bindings/

我可以毫无问题地选择标准option元素,但是当它们是click() 方法的子元素时,不会更改所选项目。<select><optgroup>

找到了元素(我可以找到元素var_dump的详细信息)。我正在使用的代码是:

$xpath = "//select[@name='{$element}']/optgroup[@label='{$optgrp}']/option[@value='{$value}']";
$element = $this->_webdriver->findElementBy(LocatorStrategy::xpath, $xpath);
$element->click();

如果我然后执行以下操作,它将失败。

$this->assertTrue($element->isSelected());
4

0 回答 0