如何在 PHPUnit 测试中启动 InternetExplorerDriver

2022-01-25 00:00:00 selenium internet-explorer php phpunit

已下载 InternetExplorerDriver,但我不知道如何在 php 测试中启动它.我正在使用 https://github.com/chibimagic/WebDriver-PHP/

Downloaded InternetExplorerDriver but i don't know how to start it in php tests. I'm using https://github.com/chibimagic/WebDriver-PHP/

推荐答案

  1. 从网站下载 selenium-server-standalone-2.31.0.jarhttps://code.google.com/p/selenium/downloads/list

从站点 https://code 下载 IEDriverServer_Win32_2.31.0.zip.google.com/p/selenium/downloads/list,然后解压缩

将两个下载的文件添加到一个目录中,并将此目录添加到系统变量路径中

Add both downloaded file into one directory, and add this dir to system variable path

将 C:Program FilesInternet Explorer 添加到系统变量路径中

Add C:Program FilesInternet Explorer into system variable path

打开命令提示符类型

java -jar -Dwebdriver.ie.driver=IEDriverServer.exe selenium-server-standalone-2.31.0.jar

返回您的 webdriver 设置并将firefox"更改为internet explorer"

Go back to your webdriver setting and change 'firefox' to 'internet explorer'

然后就可以在ie中开始测试了,不过别忘了把ie的默认缩放比例从125%改成100%.

Then you can start testing in ie, but do not forget change ie's default zooming from 125% to 100%.

相关文章