帮助下载 Selenium Webdriver?
我有 Selenium IDE,我想安装 Selenium Webdriver。 1)谁能告诉我在哪里可以下载selenium webdriver。我在文档中没有看到任何可用的链接。 2)我可以将 selenium webdriver 与 PHPUnit 一起使用吗?我看到一些材料说 selenium 2 不支持 php,但是有一些可用于 webdriver 的 phpbindings 的下载链接,这到底是什么? 3)如果我有 Selenium Webdriver,我还需要 selenium 服务器在不同的浏览器中运行测试用例吗?
我将不胜感激您的回答...
I have Selenium IDE and i want to install Selenium Webdriver.
1) Can anyone tell me where can i download selenium webdriver. i don't see any link available in the documentation.
2)Can i use selenium webdriver with PHPUnit? I see some materials saying php is not supported in selenium 2 however there are some download links available for phpbindings for webdriver what is this exactly?
3)If i have Selenium webdriver do i still need selenium server to run test cases in different browsers?
I would appreciate your answers...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我完全同意你的观点。他们有大量的文档,但他们在解释你真正需要什么方面做得很糟糕。我花了大约两天的时间才把所有的碎片拼凑起来。您将需要一些东西...
如果您使用 C# 运行测试,请下载 NUnit、C# 客户端驱动程序。在 Visual Studio 中创建一个类库项目,并引用 NUnit(适用于适当的 dotnet 版本)和 C# 客户端驱动程序的 dll(程序集)。编译你的类库。它应该在 bin\Debug 目录中创建一个 dll。然后进入 NUnit,创建一个项目,然后在 bin\Debug 目录中打开程序集。这应该可以帮助你开始。
如果您使用 Java 进行开发,请下载 JUnit(而不是 NUnit),然后下载 Java 客户端驱动程序,并使用 Eclipse 而不是 Visual Studio。您可以直接从 Eclipse 启动 JUnit。
我之前只尝试过 NUnit 和 JUnit。但我确信 PHPUnit 也可以从 Eclipse 启动(有根据的猜测)。从经验来看,Java 和 Python 的文档似乎最多,但我一直在 .NET 中做所有事情,而且没有遇到任何无法解决的问题。
单元测试软件不是必需的,但 Firefox Selenium IDE 的格式插件代码将为 NUnit (C#) 或 JUnit (Java) 等构建代码......因此大多数人都使用这些工具。
如果您想获取一些样板代码,请进入 Selenium IDE 并在选项下打开实验性功能。然后在记录命令后从格式菜单导出 C# 代码(或 Java 代码)。它不会全部转化为 100%,所以要注意这一点。只需从那里谷歌即可获得问题的答案。
需要注意的一件事... clickAndWait 命令不会在代码中转换为单击并等待。如果您正在等待操作发生,则需要在某些命令之后执行隐式等待或 thread.sleep 等待,然后才能访问下一个元素。您还需要打开本机事件,以便可以触发某些 JavaScript 事件。如果驱动程序没有打开此功能,您的火灾事件将不起作用。 WebDriver 驱动程序。
如果您还有其他问题,请告诉我。
I completely agree with you. They have a ton of documentation, but they do a horrible job of explaining what you actually need. It took me about 2 days to put all the pieces together. You will need a few things...
If you are running tests with C#, download NUnit, C# client drivers. Create a class library project in Visual Studio and reference the dlls (assemblies) for NUnit (for appropriate dotnet version) and the C# client drivers. Compile your class library. It should create a dll inside of the bin\Debug directory. Then go into NUnit, create a project, and then open your assembly in that bin\Debug directory. That should get you started.
If you're developing using Java, download JUnit (not NUnit) and then download the Java Client Drivers, and use Eclipse instead of Visual Studio. You can launch JUnit right from Eclipse.
I've only tried NUnit and JUnit before. But I'm sure PHPUnit can also be launched from Eclipse (educated guess). There seems to be the most documentation for Java and Python.. from experience, but I've been doing everything in .NET and I haven't had anything I couldn't solve.
The Unit Testing software isn't required, but the code the format add-ins for Firefox Selenium IDE will build the code for NUnit (C#) or JUnit (Java), etc... so most use those tools.
If you want to get some boilerplate code, go into Selenium IDE and turn on experimental features under options. Then export your C# code (or Java code) from the format menu after you've recorded your commands. It won't all convert 100%, so be aware of that. Just google from there to get questions answered.
One thing to watch out for... clickAndWait commands won't convert to click and wait in the code. You will either need to do an implicit wait or a thread.sleep wait after certain commands before you'll be able to access the next element if you're waiting for an action to occur. You will also want to turn on native events so you can fire certain JavaScript events. Your fire events won't work if the driver doesn't have this turned on. The WebDriver driver.
If you have any other questions, let me know.
您可以从以下位置下载 Selenium 服务器以及客户端驱动程序:
http://code.google .com/p/selenium/downloads/list
您可以从以下来源下载“php-webdriver-bindings-0.9.0.zip”:
http://code .google.com/p/php-webdriver-bindings/downloads/detail?name=php-webdriver-bindings-0.9.0.zip
You can download Selenium server as well as client driver from the following:
http://code.google.com/p/selenium/downloads/list
You can download "php-webdriver-bindings-0.9.0.zip" from the following source:
http://code.google.com/p/php-webdriver-bindings/downloads/detail?name=php-webdriver-bindings-0.9.0.zip
在 C# 上下文中:
现在,在 C# 项目中包含包的更好方法是使用 nuGet。 nuGet 是打包实用程序,当从其 powershell 命令窗口执行时,可以快速下载 dll 文件并将它们链接到项目。下面的链接详细介绍了如何使用 nUGet 安装 selenium webdriver、selenium support 和 nUnit 的软件包。
如何调用/运行在 C# 中使用远程 Webdriver 的不同类型的 Web 驱动程序浏览器
In C# context:
Now the better way of including packages in C# project is using nuGet. nuGet is packaging utility which when executed from its powershell command window, quickly downloads the dll files and links them to project. Below link details on how to use nUGet to install packages of selenium webdriver, selenium support and nUnit.
How to invoke/run different type of web driver browser using remote webdriver in C#