Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我在设置web驱动程序(selenium with php)时收到一条错误消息_Php_Selenium_Automated Tests - Fatal编程技术网

我在设置web驱动程序(selenium with php)时收到一条错误消息

我在设置web驱动程序(selenium with php)时收到一条错误消息,php,selenium,automated-tests,Php,Selenium,Automated Tests,当我运行example.php测试时,如何消除这个错误 我收到3条错误消息: (!)注意:未定义的属性:stdClass::$sessionId in 第60行的C:\xampp\htdocs\WebDriver\phpwebdriver\WebDriver.php (!)致命错误:未捕获错误:不在对象中时使用$this 第24行C:\xampp\htdocs\WebDriver\example.php中的上下文 (!)错误:在中不在对象上下文中时使用$this 第24行的C:\xam

当我运行
example.php
测试时,如何消除这个错误

我收到3条错误消息:

  • (!)注意:未定义的属性:stdClass::$sessionId in 第60行的C:\xampp\htdocs\WebDriver\phpwebdriver\WebDriver.php

  • (!)致命错误:未捕获错误:不在对象中时使用$this 第24行C:\xampp\htdocs\WebDriver\example.php中的上下文

  • (!)错误:在中不在对象上下文中时使用$this 第24行的C:\xampp\htdocs\WebDriver\example.php

  • 我是硒测试新手,我真的不知道如何解决这个问题。我试图安装各种驱动程序,但没有成功

    终端中的错误消息:

    22:37:50.504信息[ActiveSessionFactory.lambda$apply$11]-匹配 工厂 org.openqa.selenium.grid.session.remote.ServicedSession$Factory(提供 der:org.openqa.selenium.chrome.ChromeDriverService)22:37:50.929信息 [ActiveSessionFactory.apply]-功能为:{“browserName”: “chrome”,“javascriptEnabled”:true,“nativeEvents”:false,
    “版本”:“”}


    除了一个错误外,我已经把所有的错误都整理好了。我不知道如何摆脱这个。帮助(!)注意:未定义属性:stdClass::$ELEMENT在C:\xampp\htdocs\WebDriver\phpwebdriver\WebElement.php中,位于终端23:00第28行:10.206 INFO[ActiveSessionFactory.lambda$apply$11]-匹配的工厂org.openqa.selenium.grid.session.remote.ServicedSession$factory(提供者:org.openqa.selenium.firefox.GeckoDriverService)我的运行代码:require_once“phpwebdriver/WebDriver.php”$webdriver=新的webdriver(“localhost”,“4444”)$webdriver->connect(“firefox”)$webdriver->get(“);$element=$webdriver->findElementBy(LocatorStrategy::name,“q”);if($element){$element->sendKeys(array(“php webdriver”);$element->submit();}除了一个错误之外,我已经解决了所有的错误。我不知道如何摆脱它。帮助(!)注意:未定义的属性:stdClass::$ELEMENT在C:\xampp\htdocs\WebDriver\phpwebdriver\WebElement.php中,位于终端23:00:10.206信息[ActiveSessionFactory.lambda$apply$11]-匹配的工厂org.openqa.selenium.grid.session.remote.ServicedSession$factory(提供者:org.openqa.selenium.firefox.GeckoDriverService)我的运行代码:require_once“phpwebdriver/WebDriver.php”;$WebDriver=newwebdriver(“localhost”,“4444”);$WebDriver->connect(“firefox”);$WebDriver->get(“)$element=$webdriver->findElementBy(LocatorStrategy::name,“q”);if($element){$element->sendKeys(数组(“php webdriver”);$element->submit();}