使用硒的webdriver和Safari [英] Using Selenium Webdriver and Safari

查看:216
本文介绍了使用硒的webdriver和Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对硒的webdriver C#工作使用Visual Studio Express的2012年结果
我安装了最新的Safari浏览器,我创建了开发者证书从苹果的延伸和我建立的延伸和安装。

I am working on Selenium Webdriver C# using Visual Studio Express 2012.
I installed the latest safari browser and I create the developer certificate for extension from Apple and I built the extension and install it.

但即使在那之后,我无法将URL发送到浏览器。该浏览器发射成功,但在那之后我没有得到任何日志

But even after that, I am not able to send the URL to the browser. The browser is launched successfully, but after that I didn't get any logs.

错误消息是:

更多信息:未收到来自Safari浏览器扩展的连接。请验证它是否正确安装,并且是正确的版本。

Additional information: Did not receive a connection from the Safari extension. Please verify that it is properly installed and is the proper version.

这是我使用的代码:

IWebDriver driver = new SafariDriver();
driver.Navigate().GoToUrl("http://www.google.com");



在Safari不能连接到服务器。请帮帮我,谢谢。

The safari can not connect to the server. Please help me, thanks.

推荐答案

我使用的网页浏览器的NUnit测试框架和硒写在C#中测试在Visual Studio自动化。

I am writing tests in C# in Visual Studio using the NUnit test framework and Selenium for web browser automation.

尝试使用Selenium 2.45.0

Try using Selenium 2.45.0

我开始使用版本2.49.0硒的webdriver和硒WeDriver支持类(通过的NuGet在Visual Studio安装)。试图驾驶Safari浏览器,但与其他浏览器(Chrome浏览器,Firefox和IE)工作时,这是行不通的。

I started using version 2.49.0 'Selenium WebDriver' and 'Selenium WeDriver Support Classes' (installed via NuGet in Visual Studio). It would not work when trying to drive Safari but worked with the other browsers (Chrome, Firefox and IE).

我决定改变我使用的硒的版本2.45.0因为它提到这里那......硒2.45开始。 0,则必须手动安装SafariDriver浏览器扩展......。我想通2.45.0将是最好的地方开始。

I decided to change the version of Selenium I was using to 2.45.0 because it mentions here that '...Starting with Selenium 2.45.0, you must manually install the SafariDriver browser extension...'. I figured 2.45.0 would be the best place to start.

它的工作。

所以整个过程是:


  • 开启并安装的Safari浏览器的版本2.45 SafariDriver.safariextz的

  • 确认您正在使用Visual Studio中硒的webdriver 2.45.0和硒的webdriver支持类2.45.0

  • 运行测试

要在Visual Studio改变硒的版本:

To change version of Selenium in Visual Studio:


  • 工具

  • 的NuGet包经理

  • 软件包管理系统控制台(控制台窗口应该打开)

  • 类型:安装封装Selenium.Support -Version 2.45.0(这也应该改变硒的webdriver到2.45.0版本)

  • 有关软件包管理系统控制台的详细信息:的 http://docs.nuget.org/consume/package-manager-console

  • Tools
  • NuGet Package Manager
  • PackageManager Console (console window should open)
  • Type: Install-Package Selenium.Support -Version 2.45.0 (this should also change the Selenium WebDriver to version 2.45.0)
  • For more information on PackageManager Console: http://docs.nuget.org/consume/package-manager-console

这篇关于使用硒的webdriver和Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆