草庐IT

Selenium-WebDriver

全部标签

javascript - 用 Protractor 打开文件

我在互联网上找到的每个Protractor示例似乎都使用带有WebURI的browser.get。browser.get('http://localhost:8000');我想使用Selenium简单地导航到file://路径,这样我就不需要运行本地Web服务器来执行测试。我只需要一个简单的HTML页面和一些Assets。虽然这似乎行不通。browser.get('file:///Users/myusername/dev/mpproject/spec/support/index.html');当我将该URI粘贴到浏览器窗口时,我得到了一个HTML页面。当我尝试用Protractor打开

php - 错误 : The path to the driver executable must be set by the webdriver. gecko.driver 系统属性

我正在使用PHP进行自动化功能单元测试。我想使用PhpStorm在暂存环境上运行测试,我正在访问此链接:https://www.sitepoint.com/using-selenium-with-phpunit/.我已经完成了这段代码的任务:我访问过此链接但不适合我。Thepathtothedriverexecutablemustbesetbythewebdriver.gecko.driversystempropertysetHost('localhost');$this->setPort(4444);$this->setBrowserUrl('https://www.facebook

php - 未找到 Selenium 元素

我正在用PHP编写一个Selenium测试来检查Firefox中网络应用程序的性能。我想以此为基准来比较不同的性能增强(升级JQuery、PHP5.3等)。Web应用程序非常注重AJAX,到目前为止我只遇到了一个问题。我有一个AJAX调用,可以将内容加载到现有的div中。为了测试调用是否完成,我使用了以下代码行:$selenium->waitForCondition('$(\'div[id="divId"]\').height()>100',$timeout);这正如我预期的那样工作,但是当我尝试输入任何加载到div中的输入时,selenium抛出错误“Elementinput[@id

php - Selenium RC 和 PHP 初学者

我正在使用apache/php/mysql运行一个ubuntu服务器。我想在我的一个php项目中使用selenium。基本上,我想要一个设置,我可以或多或少地将粘贴代码从FirefoxSeleniumIDE(格式设置为php)复制到我的php项目中,如下所示:setBrowser("*chrome");$this->setBrowserUrl("http://www.google.com/");}publicfunctiontestMyTestCase(){$this->type("q","stackoverflow");$this->click("link=2");$this->wa

php - 无法使用PHPunit Selenium执行javascript

我正在尝试使用PHPUnit命令执行javascript代码。它执行PHP代码并发送电子邮件和其他内容。但是该php文件中有一些javascript代码将一些数据发送到第三方url。这似乎不起作用。关于如何执行javascript代码有什么想法吗? 最佳答案 对于那些正在使用PHPUnit_Extensions_Selenium2TestCase并且来自google的人。@见https://github.com/sebastianbergmann/phpunit-selenium/issues/160应该是:$this->execu

PHP fatal error : Uncaught Error: Class 'Facebook\WebDriver\ChromeOptions' not found

namespaceFacebook\WebDriver;useFacebook\WebDriver\Remote\DesiredCapabilities;useFacebook\WebDriver\Remote\RemoteWebDriver;require_once('vendor/autoload.php');$host='http://localhost:4444/wd/hub';$options=newChromeOptions();我读过这个link当我创建类ChromeOptions的对象时出现错误PHPFatalerror:UncaughtError:Class'Face

Golang + selenium 设置无头浏览器模式

前段时间写了个自动化脚本来爬点数据,但是有一个页面的cookies是无法通过发送登录请求来获得的,于是只好使用selenium来加载出页面再获取那个页面的cookies,为了不想每次都打开浏览器页面,因此需要设置无头浏览器,网上查了很久资料特此记录一下解决方法。funcGetAdminCookies(URLstring)string{ //1.开启selenium服务 //设置selium服务的选项,设置为空。根据需要设置。 ops:=[]selenium.ServiceOption{} service,err:=selenium.NewChromeDriverService("F:\\chr

php - Yii Framework testing with PHPUnit and Selenium 错误/警告

我正在使用这本书:“使用Yii1.1和PHP5进行敏捷Web应用程序开发”来开始使用Yii。在设置我的TDD环境并运行我的第一个测试时,弹出以下警告:sl@cker:/var/www/demo/protected/tests$phpunitfunctional/SiteTest.phpPHPUnit3.6.12bySebastianBergmann.Configurationreadfrom/var/www/demo/protected/tests/phpunit.xmlPHPWarning:include(SiteTest:Firefox.php):failedtoopenstrea

php - 使用 PHPUnit 和 Selenium 设置测试

你能帮我设置我的测试环境吗?我在Ubuntu上运行,安装(并运行)了selenium网络服务器,并使用PHPUnit我正在执行我的测试。很可能我遇到了一些小错误,但我现在不知道如何解决它。我的代码很简单classWebTestextendsPHPUnit_Extensions_Selenium2TestCase{protectedfunctionsetUp(){$this->setBrowser('firefox');$this->setBrowserUrl('http://www.google.com/');}publicfunctiontestTitle(){$this->url(

php - 驱动程序可执行文件的路径必须由 webdriver.chrome.driver 系统属性 (php) 设置

我在运行phpselenium测试时遇到问题。我刚切换到Ubuntu操作系统,现在我在selenium服务器上遇到了这个异常堆栈问题。Selenium服务器08:58:49.965INFO-LaunchingastandaloneSeleniumServer08:58:49.986INFO-Java:OracleCorporation25.101-b1308:58:49.986INFO-OS:Linux4.4.0-36-genericamd6408:58:49.996INFO-v2.53.0,withCorev2.53.0.Builtfromrevision35ae25b08:58:5