I use RubyMine 5.4

I want to use Internet Explorer.

Here are the first lines in a file:

require 'rubygems'
require 'watir'
#require 'watir-webdriver'
require 'test/unit'

URL = 'http://google.com/'

class TestGoogle < Test::Unit::TestCase
  def setup
    @browser = Watir::Browser.new
  end
...
end

Here is my problem. I have squiggly lines under "Watir" and "Browser" in the following line:

@browser = Watir::Browser.new

As a result, I can't use intellisense for these words, and many other words.

I can remove the squiggly lines, and use intellisense, if I uncomment

#require 'watir-webdriver'

But I've been told that I cannot require both 'watir' and 'watir-webdriver'in the same file.

To add to my confusion, in the following site:

http://wtr.rubyforge.org/rdoc/1.6.5/

On the first page, I see the lines:

require 'watir'
browser = Watir::Browser.new

I would be grateful for any advice. At my stage of learning, I really need the inellisense.

有帮助吗?

解决方案

I am using RubyMine as well and when I copy pasted your code, I didn't see any problem.

I always use 'watir-webdriver', which interanlly uses selenium webdriver (supports different browsers) instead of 'watir'.

Goto Tools -> Show Gem Environment and check whether you have 'watir-webdriver' listed.

If it is not listed there then goto Tools -> Terminal and install the watir-webdriver gem.

Refresh the project or restart the IDE to see the changes.

Hope it helps for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top