Watir question,

Oh ok, Thanks.

hi Jeol, I have a question about this gem,

Please have a look at the lines below


rubyzip is available on RubyGems, so:

gem install rubyzip

Or in your Gemfile:

gem ‘rubyzip’

I don’t understand how to use this “gem ‘rubyzip’”, I tried to include
this
line as below

gem ‘rubyzip’

Zip::File.open(‘foo.zip’) do |zip_file|
end

But it throws the following error,

:in `’: uninitialized constant Zip (NameError)

But if I install ‘gem install rubyzip’, it works fine, Could you explain
me how to use this “gem ‘rubyzip’” Please?

hi Jeol,

Thanks, It works, but it takes too much time to select a single element,
it more or less it takes 15 to 20 secs,

I used the following way to choose the select list as written below,

b.select_lists[5].select()
b.select_list(:index,5).select()
b.select_list(:xpath,’.*//).select()

It all selects, but it takes 20 sec time to select a single element from
the select list.

have you tried “require” instead of “gem”?

Yes I tried it’s working fine, I have written as shown below,

require ‘rubygem’

But I would like to know the meaning of

gem ‘rubyzip’

Because everywhere they’ve asked used either ‘gem install rubygem’ or
gem ‘rubyzip’, I don’t understand what does the second one means.

They’re probably referring to a “gemfile”. It’s part of Bundler and a
core element of Ruby on Rails.

oh ok, Thanks.

hi Jeol,

I installed WATIR 4.0.2 and WATIR 5.0.0,

While I tend to automate the same code in WATIR 4.0.2 AND WATIR 5.0.0,
WATIR 5.0.0 is very slow compared to WATIR 4.0.2 and earlier version, I
don’t know the reason, For an example, you could check with below code

require ‘rubygems’
require ‘watir’

b=Watir::Browser.new

b.goto ‘www.google.com

b.text_field(:name,‘q’).set(“ggsdfdfdsfdfdsfdsfdsfedfereretfgfghfghgfgfgfdgfgee”)