本文整理汇总了PHP中AbstractTest::_handle方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractTest::_handle方法的具体用法?PHP AbstractTest::_handle怎么用?PHP AbstractTest::_handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractTest
的用法示例。
在下文中一共展示了AbstractTest::_handle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
// return if the driver wasn't initialized
if (!$this->_driver) {
return;
}
if (self::$_config['persist']) {
try {
$alert = new Alert($this->_driver);
$alert->dismiss();
} catch (Exception $e) {
}
try {
foreach ($this->_driver->getWindowHandles() as $handle) {
// skip the original window
if ($handle == self::$_handle) {
continue;
}
// try to close any other windows that were opened
try {
$this->_driver->switchTo()->window($handle);
$this->_driver->close();
} catch (Exception $e) {
}
}
$this->_driver->switchTo()->window(self::$_handle);
$this->_driver->switchTo()->activeElement();
} catch (SeleniumUnknownErrorException $e) {
// test case may have closed the parent window
self::$_handle = null;
return;
}
$this->_driver->manage()->deleteAllCookies();
$this->_driver->manage()->timeouts()->implicitWait(0);
$this->_driver->manage()->window()->setPosition($this->_position['x'], $this->_position['y']);
$this->_driver->manage()->window()->setSize($this->_size['width'], $this->_size['height']);
$this->_driver->manage()->timeouts()->pageLoadTimeout(10000);
} else {
try {
$this->_driver->quit();
} catch (Exception $e) {
}
}
}