Firewatir:Firewatir 无法打开 Firefox
FireWatir
我最近开始使用 Firewatir 进行测试,我在安装 firewatir 时遵循了所有必需的步骤,但无法运行该脚本。
以下是我本地机器 ruby 版本的信息
: ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-mingw32]
gems displayed: C:>宝石列表
* LOCAL GEMS *
activesupport (3.0.0, 2.3.8) 建造者(2.1.2) 公共水域 (1.6.5) 火警 (1.6.5) 锄头 (2.6.2) json_pure (1.4.6) 耙子 (0.8.7) 红宝石铸造 (2.0.4) s4t-utils (1.0.4) 用户选择 (1.1.6.1) xml-simple (1.0.12)
########I used the sample script from the web#Include the FireWatir file.
require 'firewatir'
ff=FireWatir::Firefox.new
#Open yahoo mail.
ff.goto("http://mail.yahoo.com")
#Put your user name.
ff.text_field(:name,"login").set("User_Name")
#Put your password.
ff.text_field(:name,"passwd").set("Password")
#Click Sign In button.
ff.button(:value,"Sign In").click
#Click Sign Out button.
ff.link(:text, "Sign Out").click
#Close the browser.
ff.close
当我从命令提示符运行上述脚本时,它不是打开 Firefox 浏览器,而是打开一个对话框来选择一个程序来打开它。
如果有人能帮助我或为我指明正确的方向,我真的很感激。
谢谢
FireWatir
I recently started using Firewatir for testing, I followed all the required steps while installing firewatir but I am not able to run the script.
Here is the information from my local machine
ruby version: ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-mingw32]
gems installed:
C:>gem list
* LOCAL GEMS *
activesupport (3.0.0, 2.3.8)
builder (2.1.2)
commonwatir (1.6.5)
firewatir (1.6.5)
hoe (2.6.2)
json_pure (1.4.6)
rake (0.8.7)
rubyforge (2.0.4)
s4t-utils (1.0.4)
user-choices (1.1.6.1)
xml-simple (1.0.12)
########I used the sample script from the web
#Include the FireWatir file.
require 'firewatir'
ff=FireWatir::Firefox.new
#Open yahoo mail.
ff.goto("http://mail.yahoo.com")
#Put your user name.
ff.text_field(:name,"login").set("User_Name")
#Put your password.
ff.text_field(:name,"passwd").set("Password")
#Click Sign In button.
ff.button(:value,"Sign In").click
#Click Sign Out button.
ff.link(:text, "Sign Out").click
#Close the browser.
ff.close
When I run the above script from the command prompt, instead of opening the firefox browser, it is opening a dialog box to select a program to open this.
I really appreciate that if anyone can help me with this or point me to the right directions.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够解决该问题,但不确定具体如何解决,但我按照以下步骤操作:
1. 卸载并安装ruby
2.宝石更新
3.将activesupport从3.0.0版本回滚到activesupport 2.3.8。
4.卸载JSSH并再次安装,确实解决了问题
I was able to resolve the issue,not sure exactly how but I followed the following steps:
1. Uninstall and install ruby
2. gem update
3. rolled back activesupport from version 3.0.0 to activesupport 2.3.8.
4. uninstalled JSSH and installed it again and that sure fixed the issue