使用C#在Windows自动Safari网络浏览器 [英] Automate Safari web browser using c# on Windows

查看:173
本文介绍了使用C#在Windows自动Safari网络浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人已经成功地进行管理,或知道如何在Windows平台上自动Safari网络浏览器。

I wondered if anyone had successfully managed, or knew how to automate the Safari web browser on the Windows platform.

在理想情况下,我想以类似的方式自动Safari浏览器使用 MSHTML 的Internet Explorer。做不到这一点的方式注入到JavaScript的运行过程中也将被罚款。我使用的JavaScript注入法通过 jssh 插件自动Firefox浏览器。

Ideally I would like to automate Safari in a similar way to using mshtml for Internet Explorer. Failing that a way to inject JavaScript into the running process would also be fine. I've used the JavaScript injection method to automate Firefox via the jssh plug-in.

我期待使用.NET来增强现有的自动化框架自动化浏览器华廷

I'm looking to automate the browser using .Net to enhance an existing automation framework WatiN

修改:虽然我觉得硒可能是一个伟大的选择。在某些情况下自动Safari浏览器,我想用不需要服务器也就是说硒核心或中间上安装软件的解决方案在硒的远程控制的情况下,代理服务器。

Edit: Whilst I think selenium might be a great choice for automating Safari in certain scenarios, I would like to use a solution that does not require installing software on the server i.e. Selenium Core or an intermediate proxy server in the case of Selenium Remote Control.

更新:23-03-2009
虽然我还没有找到一种方法来自动Safari浏览器,我已经找到一种方法Chrome浏览器内自动完成的Webkit。如果使用--remote壳口运行的Chrome = 9999命令行开关(参考: HTTP: //www.ericdlarson.com/misc/chrome_command_line_flags.html ),您可以发送的JavaScript浏览器。

Update: 23-03-2009: Whilst I've not yet found a way to automate Safari, I have found a way to automate Webkit inside of Chrome. If you run Chrome using the --remote-shell-port=9999 command line switches (ref: http://www.ericdlarson.com/misc/chrome_command_line_flags.html) you can send javascript to the browser.

一旦连接到远程调试SEESION

Once connected to the remote debug seesion


  • 发送调试()以附加到当前标签

  • 使用发送任何JavaScript命令的打印后,即打印document.window.location.href

  • Send debug() to attach to the current tab
  • Send any javascript command using print, i.e. print document.window.location.href

我们已经用此方法来添加铬以华廷支持

We've used this method to add Chrome support to WatiN

推荐答案

在这里可能会在那里我使用上述方法在C#中自动Chrome中检查我的文章

you might check my post here where I am using the method described above to automate Chrome in C#

http://markcz.word$p$pss.com/2012/02/18/automating-chrome-browser-from-csharp/

马丁

这篇关于使用C#在Windows自动Safari网络浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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