![watir](https://i-blog.csdnimg.cn/blog_migrate/c8d8be8bbfd36ef3d09c27d31f5971e9.png)
watir
Folks keep calling after 9pm and waking the baby. We use Vonage, and I really wish they had a feature where I could indicate "do not call" times. Alas, they don't. So, then I wished for a Vonage Web Service. Nope.
晚上9点以后,人们会继续打电话给婴儿。 我们使用Vonage ,我真的希望他们有一个可以指示“不打电话”时间的功能。 las,他们没有。 因此,我当时希望获得Vonage Web服务。 不。
So, instead here's a Watir script, recorded with a early version of Michael Kelly and John Hann's port of WatirMaker to Ruby (via "ruby watirmaker.rb > myscript.rb") then edited to taste.
因此,这是一个Watir脚本,记录了迈克尔·凯利( Michael Kelly)和约翰·汉恩(John Hann)的WatirMaker到Ruby的早期版本(通过“ ruby watirmaker.rb> myscript.rb”),然后进行编辑以进行品尝。
#Enable Instant Forward to Voice Mail
require 'watir'
include Watir#启用即时转发到语音邮件需要“ watir” 包括瓦蒂尔
ie = IE.new
ie.goto( 'http://www.vonage.com/' )即= IE.new ie.goto('http://www.vonage.com/')
ie.text_field( :name, 'username' ).set( 'username' )
ie.text_field( :name, 'password' ).set( 'password' )
ie.button( :name, 'submit' ).clickie.text_field(:name,'username').set('username') ie.text_field(:name,'password').set('password') ie.button(:name,'submit').click
ie.link(:text,"Features").click
ie.link(:text,“ Features”)。click
ie.button( :name, 'callForwardingButton' ).click
ie.button(:name,'callForwardingButton').click
ie.select_list( :name, 'callForwardingSeconds' ).select( 'Instantly' )
ie.text_field( :name, 'singleAddress' ).set( '15035551234' )ie.select_list(:name,'callForwardingSeconds').select('Instantly') ie.text_field(:name,'singleAddress').set('15035551234')
ie.button(:value,'Enable').click
ie.button(:value,'Enable')。click
ie.link(:text,"Log Out").click
ie.closeie.link(:text,“登出”).click 即关闭
And the disable...
还有禁用...
require 'watir'
include Watir需要“ watir” 包括瓦蒂尔
ie = IE.new
ie.goto( 'http://www.vonage.com/' )即= IE.new ie.goto('http://www.vonage.com/')
ie.text_field( :name, 'username' ).set( 'username')
ie.text_field( :name, 'password' ).set( 'password' )
ie.button( :name, 'submit' ).clickie.text_field(:name,'username')。set('username') ie.text_field(:name,'password').set('password') ie.button(:name,'submit').click
ie.link(:text,"Features").click
ie.link(:text,“ Features”)。click
ie.button( :name, 'callForwardingButton' ).click
ie.button(:name,'callForwardingButton').click
ie.button(:value,'Disable').click
ie.button(:value,'Disable')。click
ie.link(:text,"Log Out").click
ie.closeie.link(:text,“登出”).click 即关闭
These now run on a schedule in my house using the Windows Scheduler. If you run them like 'ruby enable.rb -b' they run in the background and you'll never see Internet Explorer.
现在,这些命令将使用Windows Scheduler在我家的日程表上运行。 如果您像“ ruby enable.rb -b ”一样运行它们,它们将在后台运行,并且您将永远不会看到Internet Explorer。
翻译自: https://www.hanselman.com/blog/a-very-poor-mans-vonage-web-service-using-watir
watir