[wtr-general] Re: watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Chuck van der Linden
oh that advice has to be worth a lot more than you just valued it at..
at least a $0.02 if not $0.1 when adjusting for inflation. And your
point is well taken (along with a big facepalm on my part)  Not
intentionally causing dependencies that break a large number of tests
is a good rule to live by, and your approach is a bit more work and
would require specific tests for objects being in view, (but that's a
good thing, it documents that part of the story, especially if using
doc by example) instead of having it be sort of implied and tested by
inference instead of via a specific test.   But this is a good example
of where killing two birds with one stone seems good at first, but has
a large downside (big numbers of blocked tests) caused by cutting a
few corners.

On Oct 11, 10:31 am, Cliff Cyphers  wrote:
> >> Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?
>
> > The main difficulty I have with this is that I've worked on a number
> > of pages where part of the design requirements were that everything
> > had to pretty much fit onto a specific default page size such as
> > 1024x768, and if something was 'not in view' then I wanted the script
> > to fail.  In that case having the script 'break' if something was
> > outside that area is not a behavior I'd want to change.
>
> It's still a good idea to be able to scroll to the required element,
> although auto scrolling may be desired or unwanted depending on usage.
>  In either case, you can always test your apps for such requirements
> by:
>
> 1.  Resize browser to spec's dimensions.
> 2.  Call Browser::Element.in_viewable_area?
>
> But other test which require clicking on the element's link would
> still pass if the element was automatically scrolled to.  Why break
> multiple test because the element isn't in a viewable area?  Have the
> one test that check the speck as you mentioned and allow all of your
> additional test which navigate the links and test other functionality
> do their job, to find low hanging fruit faster.
>
> just my 0.0001 cents

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: trying to click a link without an id or name.

2011-10-11 Thread Chuck van der Linden
On Oct 11, 6:52 pm, Joe Fleck  wrote:
> Hi,
>
> I got the example Rahul suggested to work.  I was using the text of the link
> not one of the value within the href.
> Is there a way to use the text?
>
> Thank you,
> Joe

yes

browser.link(:text, "textofmylink").click

Another option for this kind of thing is to locate some outer
container that has a name or ID.  For example lets say you have a page
that has both a header and a footer (with each one in a div) and there
are 'about our company' links in both places, and you want to make
sure you are clicking a specific one.  Then you can do something along
these lines

browser.div(:id, 'footer').link(:text, 'about our company').click

Or say you have a table, and there are a bunch of 'buy' links in one
column, and book names in another column.. In that case you can be a
little devious and locate the cell with the bookname you want, then in
the parent of that cell (a table-row) you can click on the link that
says buy..  it ends up looking something like this

browser.cell(:text, 'Everyday Scripting with Ruby').parent.link(:text,
'Buy').click

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: trying to click a link without an id or name.

2011-10-11 Thread Joe Fleck
Hi,

I got the example Rahul suggested to work.  I was using the text of the link
not one of the value within the href.
Is there a way to use the text?

Thank you,
Joe

On Tue, Oct 11, 2011 at 9:02 PM, Joe Fleck  wrote:

> Hi Joe D. & Rahul,
>
> Thank you for responding.
>
> I tried both methods and the script failed.
>
>
> $browser.link(:href => /Budget Management/).click
> The error message that was posted.
>
> .rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:248:in
>  `assert_exists': unable to locate element, using {:tag_name=>"a",
> :href=>/Budget Management/} (Watir::Exception::UnknownObjectException)
>
> and the index
>
> remote server] resource://fxdriver/modules/atoms.js:9477:in `unknown':
> Element is not currently visible and so may not be interacted with
> (Selenium::WebDriver::Error::ElementNotDisplayedError)
> from [remote server]
> file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
> fxdri...@googlecode.com/components/nsCommandProcessor.js:256:in `unknown'
> from [remote server]
> file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
> fxdri...@googlecode.com/components/nsCommandProcessor.js:305:in `unknown'
> from [remote server]
> file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
> fxdri...@googlecode.com/components/nsCommandProcessor.js:320:in `unknown'
> from [remote server]
> file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
> fxdri...@googlecode.com/components/nsCommandProcessor.js:197:in `unknown'
> from [remote server] :0:in `unknown'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:45:in
> `assert_ok'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:15:in
> `initialize'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
> `new'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
> `create_response'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/default.rb:64:in
> `request'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:35:in
> `call'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:410:in
> `raw_execute'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:388:in
> `execute'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:236:in
> `clickElement'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/element.rb:34:in
> `click'
> from
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:67:in
> `click'
> from /Users/josephfleck/Documents/workspace/test/test.rb:328
>
>
> $browser.div(:class => 'discussion-meta-wrap').links.size ?
>
> It gives me a number of 10 so I could iterate through all of the links.
>
>
>
> On Tue, Oct 11, 2011 at 7:37 PM, Joe DiMauro  wrote:
>
>> You can always use the links :index
>> For example if this were the first link on the page:
>>
>> browser.link(:index => 1).click   (If using Watir which uses One based
>> indexing by default)
>> browser.link(:index => 0).click   (If using Watir-WebDriver which uses
>> Zero based indexing)
>>
>> Joe D.
>>
>> On Oct 11, 2:48 pm, Joe Fl  wrote:
>> > Hi,
>> >
>> > Is there anyway to click a link when it doesn't have an id or name
>> > attached to it?
>> >
>> > HTML code:
>> > 
>> > Topics:
>> > http://.com/channels/naph-member-community/
>> > navigational_categories/discussions/pages/detail/
>> > ChannelResourceCategory/90">Ambulatory/Outpatient Care
>> >
>> > Thank you,
>> > Joe
>>
>> --
>> Before posting, please read http://watir.com/support. In short: search
>> before you ask, be nice.
>>
>> watir-general@googlegroups.com
>> http://groups.google.com/group/watir-general
>> watir-general+unsubscr...@googlegroups.com
>>
>
>

-- 
Before posting, p

Re: [wtr-general] Re: trying to click a link without an id or name.

2011-10-11 Thread Joe Fleck
Hi Joe D. & Rahul,

Thank you for responding.

I tried both methods and the script failed.


$browser.link(:href => /Budget Management/).click
The error message that was posted.
.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:248:in
 `assert_exists': unable to locate element, using {:tag_name=>"a",
:href=>/Budget Management/} (Watir::Exception::UnknownObjectException)

and the index

remote server] resource://fxdriver/modules/atoms.js:9477:in `unknown':
Element is not currently visible and so may not be interacted with
(Selenium::WebDriver::Error::ElementNotDisplayedError)
from [remote server]
file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
fxdri...@googlecode.com/components/nsCommandProcessor.js:256:in `unknown'
from [remote server]
file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
fxdri...@googlecode.com/components/nsCommandProcessor.js:305:in `unknown'
from [remote server]
file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
fxdri...@googlecode.com/components/nsCommandProcessor.js:320:in `unknown'
from [remote server]
file:///var/folders/xk/0_wzz4td6r5gnzxvmmt9g5l4gn/T/webdriver-profile20111011-1521-13ok0p7/extensions/
fxdri...@googlecode.com/components/nsCommandProcessor.js:197:in `unknown'
from [remote server] :0:in `unknown'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:45:in
`assert_ok'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
`new'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:54:in
`create_response'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/default.rb:64:in
`request'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/http/common.rb:35:in
`call'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:410:in
`raw_execute'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:388:in
`execute'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/remote/bridge.rb:236:in
`clickElement'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/selenium-webdriver-2.7.0/lib/selenium/webdriver/common/element.rb:34:in
`click'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.4/lib/watir-webdriver/elements/element.rb:67:in
`click'
from /Users/josephfleck/Documents/workspace/test/test.rb:328


$browser.div(:class => 'discussion-meta-wrap').links.size ?

It gives me a number of 10 so I could iterate through all of the links.


On Tue, Oct 11, 2011 at 7:37 PM, Joe DiMauro  wrote:

> You can always use the links :index
> For example if this were the first link on the page:
>
> browser.link(:index => 1).click   (If using Watir which uses One based
> indexing by default)
> browser.link(:index => 0).click   (If using Watir-WebDriver which uses
> Zero based indexing)
>
> Joe D.
>
> On Oct 11, 2:48 pm, Joe Fl  wrote:
> > Hi,
> >
> > Is there anyway to click a link when it doesn't have an id or name
> > attached to it?
> >
> > HTML code:
> > 
> > Topics:
> > http://.com/channels/naph-member-community/
> > navigational_categories/discussions/pages/detail/
> > ChannelResourceCategory/90">Ambulatory/Outpatient Care
> >
> > Thank you,
> > Joe
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Chuck van der Linden
On Oct 11, 9:40 am, Babu  wrote:
> if i uninstall ruby then i have to install all the  gems again
> manually since in my office there is firewall issue so i download and
> install all the gems manually.
>

You could look into using RVM (for linux/mac) or PIK (windows) to
manage multiple versions of ruby, and sets of gems, at once.  That
might provide you with some shortcuts, and I think when you sync/clone
a set of gems it's going by what's installed via the gem manager so
might let you get rid of any bogus files you are saddled with

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: trying to click a link without an id or name.

2011-10-11 Thread Joe DiMauro
You can always use the links :index
For example if this were the first link on the page:

browser.link(:index => 1).click   (If using Watir which uses One based
indexing by default)
browser.link(:index => 0).click   (If using Watir-WebDriver which uses
Zero based indexing)

Joe D.

On Oct 11, 2:48 pm, Joe Fl  wrote:
> Hi,
>
> Is there anyway to click a link when it doesn't have an id or name
> attached to it?
>
> HTML code:
> 
> Topics:
> http://.com/channels/naph-member-community/
> navigational_categories/discussions/pages/detail/
> ChannelResourceCategory/90">Ambulatory/Outpatient Care
>
> Thank you,
> Joe

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Joe DiMauro
Babu,

What do you now get fromWatir::VERSION

Joe


On Oct 11, 1:15 pm, Babu  wrote:
> i already removed the older version of firewatir and commonwatir
> activesupport (3.1.1)
> builder (3.0.0)
> child-process-manager (0.0.3)
> childprocess (0.2.2)
> commonwatir (2.0.2)
> fattr (2.2.0)
> ffi (1.0.9)
> firewatir (1.9.4)
> flexmock (0.9.0)
> hoe (2.12.3)
> json_pure (1.6.1)
> minitest (2.6.1)
> multi_json (1.0.3)
> rake (0.9.2)
> rautomation (0.6.3)
> rubygems-update (1.8.10)
> rubyzip (0.9.4)
> s4t-utils (1.0.4)
> selenium-webdriver (2.7.0)
> session (3.1.0)
> user-choices (1.1.6.1)
> watir (2.0.2)
> watir-webdriver (0.3.5, 0.3.4)
> win32-api (1.4.8)
> win32-process (0.6.5)
> windows-api (0.4.0)
> windows-pr (1.2.1)
> xml-simple (1.1.0)
>
> still i have 1.4.1 on Watir::IE::VERSION
> thanks
>
> On Oct 11, 1:53 pm, Chuck van der Linden  wrote:
>
> > Are there some individual files he could hunt down and remove, and
> > then just re-install the watir gem?
>
> > Would getting rid of the 1.6.5 versions of commonwatir and firewatir
> > help?
>
> > On Oct 11, 9:40 am, Babu  wrote:
>
> > > if i uninstall ruby then i have to install all the  gems again
> > > manually since in my office there is firewall issue so i download and
> > > install all the gems manually.
>
> > > On Oct 11, 11:12 am, Željko Filipin 
> > > wrote:
>
> > > > As I said, you probably have 1.4.1 installed from exe file. Uninstall 
> > > > ruby
> > > > and install it again.
>
> > > > Zeljko
>
> > > > On Tuesday, October 11, 2011, Babu  wrote:
> > > > > hi joe,
> > > > > i did exactly what you told.
> > > > > =
> > > > > C:\Suvo>
> > > > > Watir::FileField
> > > > > Watir::Button
> > > > > Watir::SelectList
> > > > > Watir::Link
> > > > > Watir::Image
> > > > > Watir::TableCell
> > > > > Watir::TableRow
> > > > > Watir::TableBody
> > > > > Watir::TableBodies
> > > > > Watir::Table
> > > > > Watir::Label
> > > > > Watir::Span
> > > > > Watir::Div
> > > > > Watir::P
> > > > > Watir::SpanDivCommon
> > > > > 1.4.1
>
> > > > > C:\Suvo>gem list watir
>
> > > > > *** LOCAL GEMS ***
>
> > > > > watir (2.0.2)
> > > > > watir-webdriver (0.3.5, 0.3.4)
>
> > > > > C:\Suvo>
>
> > > > > still i have 1.4.1 on Watir::IE::VERSION
> > > > > here is my more deatils:
> > > > > ==
> > > > > C:\Suvo>ruby -v
> > > > > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
>
> > > > > C:\Suvo>gem -v
> > > > > 1.8.10
>
> > > > > C:\Suvo>gem list
>
> > > > > *** LOCAL GEMS ***
>
> > > > > activesupport (3.1.1)
> > > > > builder (3.0.0)
> > > > > child-process-manager (0.0.3)
> > > > > childprocess (0.2.2)
> > > > > commonwatir (2.0.2, 1.6.5)
> > > > > fattr (2.2.0)
> > > > > ffi (1.0.9)
> > > > > firewatir (1.9.4, 1.6.5)
> > > > > flexmock (0.9.0)
> > > > > hoe (2.12.3)
> > > > > json_pure (1.6.1)
> > > > > minitest (2.6.1)
> > > > > multi_json (1.0.3)
> > > > > rake (0.9.2)
> > > > > rautomation (0.6.3)
> > > > > rubygems-update (1.8.10, 1.8.9)
> > > > > rubyzip (0.9.4)
> > > > > s4t-utils (1.0.4)
> > > > > selenium-webdriver (2.7.0)
> > > > > session (3.1.0)
> > > > > user-choices (1.1.6.1)
> > > > > watir (2.0.2)
> > > > > watir-webdriver (0.3.5, 0.3.4)
> > > > > win32-api (1.4.8)
> > > > > win32-process (0.6.5)
> > > > > windows-api (0.4.0)
> > > > > windows-pr (1.2.1)
> > > > > xml-simple (1.1.0)
>
> > > > > thanks
>
> > > > > On Oct 11, 8:41 am, Joe DiMauro  wrote:
> > > > >> Babu,
>
> > > > >> I can see why you are confused as the value returned from the method
> > > > >> Watir::IE::VERSION does not match the version of the gem.
>
> > > > >> Watir::IE::VERSION gives you the version of the IE Browser.
> > > > >> Watir::VERSION gives you the version of Watir.
>
> > > > >> That said, here are some things to check:
> > > > >> 1. What versions of the gem are installed? You can have multiple
> > > > >> versions.
> > > > >> 2. Cleanup any unneeded version
> > > > >> 3. See what  is reported using Watir::IE:VERSION
> > > > >> 4. See what is reported using Watir::VERSION
>
> > > > >> Lets start with step 1.
> > > > >> Use the gem list command to see what versions are installed. For
> > > > >> example:
> > > > >>     C:\Users\Joe\workspace>gem list watir
>
> > > > >>     *** LOCAL GEMS ***
>
> > > > >>     watir (1.9.2, 1.6.5)
> > > > >>     watir-webdriver (0.3.5, 0.3.2)
>
> > > > >> Notice that it reports on any gem that contaisn "watir" in its name.
>
> > > > >> Step 2.
> > > > >> Now use the gem cleanup command to remove the old version.
> > > > >>     C:\Users\Joe\workspace>gem cleanup watir
> > > > >>     Cleaning up installed gems...
> > > > >>     Attempting to uninstall watir-1.6.5
> > > > >>     Successfully uninstalled watir-1.6.5
> > > > >>     Clean Up Complete
>
> > > > >> Recheck the versions
> > > > >>     C:\Users\Joe\workspace>gem list watir
>
> > > > >>     *** LOCAL GEMS ***
>
> > > > >>     watir (1.9.2)
> > > > >>     watir-webdriver (0.3.5, 0.3.2)
> > > > >>     watirworks (0.1.4)
>
> > > > >> Step 3.
> > > > >> Now

Re: [wtr-general] trying to click a link without an id or name.

2011-10-11 Thread Rahul Sharma
Yes you can use the href attribute as well. This should work. If you don't want 
to use the whole href you can use the regex as well as below.

browser.link(:href => /naph-member-community/).click
On 11 Oct 2011, at 21:48, Joe Fl wrote:

> Hi,
> 
> Is there anyway to click a link when it doesn't have an id or name
> attached to it?
> 
> HTML code:
> 
> Topics:
> http://.com/channels/naph-member-community/
> navigational_categories/discussions/pages/detail/
> ChannelResourceCategory/90">Ambulatory/Outpatient Care
> 
> Thank you,
> Joe
> 
> -- 
> Before posting, please read http://watir.com/support. In short: search before 
> you ask, be nice.
> 
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com

Regards,
Rahul Sharma

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Joe Fl
Hi Al,

Awesome that worked.  I can't believe that was it.  Why is it like
that and should I expect more like this?

Thank you,
Joe

On Oct 11, 4:32 pm, Al Snow  wrote:
> Look at 
> this:http://groups.google.com/group/watir-general/browse_thread/thread/707...
>
> Date: Tue, 11 Oct 2011 16:18:03 -0400
> Subject: Re: [wtr-general] Re: Trying to use SafariWatir and receiving an 
> error when keying value into a text_field
> From: joeflec...@gmail.com
> To: watir-general@googlegroups.com
>
> Ok,
>
> I made the correct to the script to initialize the browser variable.  I ran 
> my script again and it seems it is broken at the password field.
>
> Line from my script:
>  puts "Key in correct password."
>
>   $browser.text_field(:type, 'password').set user_pswd
>
> ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:85:in
>  `method_missing': Watir::Exception::MissingWayOfFindingObjectException
>
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
>  `send'
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
>  `locator'
>
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:534:in
>  `operate_by_locator'
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:149:in
>  `operate'
>
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
>  `focus'
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
>  `set'
>
>     from 
> /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43
>
> I have also tried
>
>  puts "Key in correct password."
>   $browser.text_field(:id, 'password').set user_pswd
>
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:661:in
>  `execute': Unable to locate TextField, using :id and "password" 
> (Watir::Exception::UnknownObjectException)
>
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
>  `focus'
>     from 
> /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
>  `set'
>
>     from 
> /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43
>
> It can find the email address field just find using (the below) without any 
> problems.
>
> #Typing in user name into User Name field
>
>   puts "Key in correct username."
>   $browser.text_field(:name, 'username').set user_Ideer
>
> The script works just fine in Firefox and Chrome but using safariwatir it 
> stops here.
>
> Thank you,
>
> Joe
>
> On Tue, Oct 11, 2011 at 1:49 PM, Željko Filipin  
> wrote:
>
> On 11. 10. 2011., at 18:15, Joe Fl  wrote:
>
> > undefined method `text_field' for nil:NilClass (NoMethodError)
>
> That means @browser variable is not initialized, if I understood yourcode.
>
> > Do I need the require 'watir' along with the require 'safariwatir'
> > request in my script?
>
> No. I am not sure that you can even install watir on mac.
>
> Zeljko
>
> --
>
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> watir-general@googlegroups.com
>
> http://groups.google.com/group/watir-general
>
> watir-general+unsubscr...@googlegroups.com
>
> --
>
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> watir-general@googlegroups.com
>
> http://groups.google.com/group/watir-general
>
> watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] trying to click a link without an id or name.

2011-10-11 Thread Joe Fl
Hi,

Is there anyway to click a link when it doesn't have an id or name
attached to it?

HTML code:

Topics:
http://.com/channels/naph-member-community/
navigational_categories/discussions/pages/detail/
ChannelResourceCategory/90">Ambulatory/Outpatient Care

Thank you,
Joe

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


RE: [wtr-general] Re: Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Al Snow

Look at this: 
http://groups.google.com/group/watir-general/browse_thread/thread/707c0ac677e10af2


Date: Tue, 11 Oct 2011 16:18:03 -0400
Subject: Re: [wtr-general] Re: Trying to use SafariWatir and receiving an error 
when keying value into a text_field
From: joeflec...@gmail.com
To: watir-general@googlegroups.com

Ok,

I made the correct to the script to initialize the browser variable.  I ran my 
script again and it seems it is broken at the password field.

Line from my script:
 puts "Key in correct password."

  $browser.text_field(:type, 'password').set user_pswd

ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:85:in
 `method_missing': Watir::Exception::MissingWayOfFindingObjectException

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
 `send'
from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
 `locator'

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:534:in
 `operate_by_locator'
from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:149:in
 `operate'

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
 `focus'
from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
 `set'

from /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43

I have also tried 

 puts "Key in correct password."
  $browser.text_field(:id, 'password').set user_pswd


/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:661:in
 `execute': Unable to locate TextField, using :id and "password" 
(Watir::Exception::UnknownObjectException)

from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
 `focus'
from 
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
 `set'

from /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43

It can find the email address field just find using (the below) without any 
problems.

#Typing in user name into User Name field

  puts "Key in correct username."
  $browser.text_field(:name, 'username').set user_Ideer

The script works just fine in Firefox and Chrome but using safariwatir it stops 
here.

Thank you,

Joe

On Tue, Oct 11, 2011 at 1:49 PM, Željko Filipin  
wrote:

On 11. 10. 2011., at 18:15, Joe Fl  wrote:

> undefined method `text_field' for nil:NilClass (NoMethodError)

>



That means @browser variable is not initialized, if I understood yourcode.





> Do I need the require 'watir' along with the require 'safariwatir'

> request in my script?



No. I am not sure that you can even install watir on mac.



Zeljko



--

Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.



watir-general@googlegroups.com

http://groups.google.com/group/watir-general

watir-general+unsubscr...@googlegroups.com






-- 

Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

 

watir-general@googlegroups.com

http://groups.google.com/group/watir-general

watir-general+unsubscr...@googlegroups.com
  

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Joe Fleck
Ok,

I made the correct to the script to initialize the browser variable.  I ran
my script again and it seems it is broken at the password field.

Line from my script:
 puts "Key in correct password."
  $browser.text_field(:type, 'password').set user_pswd

ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:85:in
`method_missing': Watir::Exception::MissingWayOfFindingObjectException
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
`send'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in
`locator'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:534:in
`operate_by_locator'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:149:in
`operate'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
`focus'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
`set'
from
/Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43

I have also tried

 puts "Key in correct password."
  $browser.text_field(:id, 'password').set user_pswd

/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:661:in
`execute': Unable to locate TextField, using :id and "password"
(Watir::Exception::UnknownObjectException)
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in
`focus'
from
/Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in
`set'
from
/Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43

It can find the email address field just find using (the below) without any
problems.

#Typing in user name into User Name field
  puts "Key in correct username."
  $browser.text_field(:name, 'username').set user_Ideer

The script works just fine in Firefox and Chrome but using safariwatir it
stops here.

Thank you,
Joe

On Tue, Oct 11, 2011 at 1:49 PM, Željko Filipin wrote:

> On 11. 10. 2011., at 18:15, Joe Fl  wrote:
> > undefined method `text_field' for nil:NilClass (NoMethodError)
> >
>
> That means @browser variable is not initialized, if I understood yourcode.
>
>
> > Do I need the require 'watir' along with the require 'safariwatir'
> > request in my script?
>
> No. I am not sure that you can even install watir on mac.
>
> Zeljko
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Babu
i already removed the older version of firewatir and commonwatir
activesupport (3.1.1)
builder (3.0.0)
child-process-manager (0.0.3)
childprocess (0.2.2)
commonwatir (2.0.2)
fattr (2.2.0)
ffi (1.0.9)
firewatir (1.9.4)
flexmock (0.9.0)
hoe (2.12.3)
json_pure (1.6.1)
minitest (2.6.1)
multi_json (1.0.3)
rake (0.9.2)
rautomation (0.6.3)
rubygems-update (1.8.10)
rubyzip (0.9.4)
s4t-utils (1.0.4)
selenium-webdriver (2.7.0)
session (3.1.0)
user-choices (1.1.6.1)
watir (2.0.2)
watir-webdriver (0.3.5, 0.3.4)
win32-api (1.4.8)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.2.1)
xml-simple (1.1.0)

still i have 1.4.1 on Watir::IE::VERSION
thanks

On Oct 11, 1:53 pm, Chuck van der Linden  wrote:
> Are there some individual files he could hunt down and remove, and
> then just re-install the watir gem?
>
> Would getting rid of the 1.6.5 versions of commonwatir and firewatir
> help?
>
> On Oct 11, 9:40 am, Babu  wrote:
>
>
>
> > if i uninstall ruby then i have to install all the  gems again
> > manually since in my office there is firewall issue so i download and
> > install all the gems manually.
>
> > On Oct 11, 11:12 am, Željko Filipin 
> > wrote:
>
> > > As I said, you probably have 1.4.1 installed from exe file. Uninstall ruby
> > > and install it again.
>
> > > Zeljko
>
> > > On Tuesday, October 11, 2011, Babu  wrote:
> > > > hi joe,
> > > > i did exactly what you told.
> > > > =
> > > > C:\Suvo>
> > > > Watir::FileField
> > > > Watir::Button
> > > > Watir::SelectList
> > > > Watir::Link
> > > > Watir::Image
> > > > Watir::TableCell
> > > > Watir::TableRow
> > > > Watir::TableBody
> > > > Watir::TableBodies
> > > > Watir::Table
> > > > Watir::Label
> > > > Watir::Span
> > > > Watir::Div
> > > > Watir::P
> > > > Watir::SpanDivCommon
> > > > 1.4.1
>
> > > > C:\Suvo>gem list watir
>
> > > > *** LOCAL GEMS ***
>
> > > > watir (2.0.2)
> > > > watir-webdriver (0.3.5, 0.3.4)
>
> > > > C:\Suvo>
>
> > > > still i have 1.4.1 on Watir::IE::VERSION
> > > > here is my more deatils:
> > > > ==
> > > > C:\Suvo>ruby -v
> > > > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
>
> > > > C:\Suvo>gem -v
> > > > 1.8.10
>
> > > > C:\Suvo>gem list
>
> > > > *** LOCAL GEMS ***
>
> > > > activesupport (3.1.1)
> > > > builder (3.0.0)
> > > > child-process-manager (0.0.3)
> > > > childprocess (0.2.2)
> > > > commonwatir (2.0.2, 1.6.5)
> > > > fattr (2.2.0)
> > > > ffi (1.0.9)
> > > > firewatir (1.9.4, 1.6.5)
> > > > flexmock (0.9.0)
> > > > hoe (2.12.3)
> > > > json_pure (1.6.1)
> > > > minitest (2.6.1)
> > > > multi_json (1.0.3)
> > > > rake (0.9.2)
> > > > rautomation (0.6.3)
> > > > rubygems-update (1.8.10, 1.8.9)
> > > > rubyzip (0.9.4)
> > > > s4t-utils (1.0.4)
> > > > selenium-webdriver (2.7.0)
> > > > session (3.1.0)
> > > > user-choices (1.1.6.1)
> > > > watir (2.0.2)
> > > > watir-webdriver (0.3.5, 0.3.4)
> > > > win32-api (1.4.8)
> > > > win32-process (0.6.5)
> > > > windows-api (0.4.0)
> > > > windows-pr (1.2.1)
> > > > xml-simple (1.1.0)
>
> > > > thanks
>
> > > > On Oct 11, 8:41 am, Joe DiMauro  wrote:
> > > >> Babu,
>
> > > >> I can see why you are confused as the value returned from the method
> > > >> Watir::IE::VERSION does not match the version of the gem.
>
> > > >> Watir::IE::VERSION gives you the version of the IE Browser.
> > > >> Watir::VERSION gives you the version of Watir.
>
> > > >> That said, here are some things to check:
> > > >> 1. What versions of the gem are installed? You can have multiple
> > > >> versions.
> > > >> 2. Cleanup any unneeded version
> > > >> 3. See what  is reported using Watir::IE:VERSION
> > > >> 4. See what is reported using Watir::VERSION
>
> > > >> Lets start with step 1.
> > > >> Use the gem list command to see what versions are installed. For
> > > >> example:
> > > >>     C:\Users\Joe\workspace>gem list watir
>
> > > >>     *** LOCAL GEMS ***
>
> > > >>     watir (1.9.2, 1.6.5)
> > > >>     watir-webdriver (0.3.5, 0.3.2)
>
> > > >> Notice that it reports on any gem that contaisn "watir" in its name.
>
> > > >> Step 2.
> > > >> Now use the gem cleanup command to remove the old version.
> > > >>     C:\Users\Joe\workspace>gem cleanup watir
> > > >>     Cleaning up installed gems...
> > > >>     Attempting to uninstall watir-1.6.5
> > > >>     Successfully uninstalled watir-1.6.5
> > > >>     Clean Up Complete
>
> > > >> Recheck the versions
> > > >>     C:\Users\Joe\workspace>gem list watir
>
> > > >>     *** LOCAL GEMS ***
>
> > > >>     watir (1.9.2)
> > > >>     watir-webdriver (0.3.5, 0.3.2)
> > > >>     watirworks (0.1.4)
>
> > > >> Step 3.
> > > >> Now that we know that only the Watir (1.9.2) em is installed lets look
> > > >> at what Watir::IE::VERSION returns.
> > > >>     C:\Users\Joe\workspace>irb
> > > >>     irb(main):001:0> require 'watir'
> > > >>     => true
> > > >>     irb(main):002:0> Watir::IE::VERSION
> > > >>     (irb):3: warning: toplevel constant VERSION referenced by
> > > >> Watir::IE::VERSION
> > > >>     => "1.

[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Chuck van der Linden
Are there some individual files he could hunt down and remove, and
then just re-install the watir gem?

Would getting rid of the 1.6.5 versions of commonwatir and firewatir
help?

On Oct 11, 9:40 am, Babu  wrote:
> if i uninstall ruby then i have to install all the  gems again
> manually since in my office there is firewall issue so i download and
> install all the gems manually.
>
> On Oct 11, 11:12 am, Željko Filipin 
> wrote:
>
>
>
>
>
>
>
> > As I said, you probably have 1.4.1 installed from exe file. Uninstall ruby
> > and install it again.
>
> > Zeljko
>
> > On Tuesday, October 11, 2011, Babu  wrote:
> > > hi joe,
> > > i did exactly what you told.
> > > =
> > > C:\Suvo>
> > > Watir::FileField
> > > Watir::Button
> > > Watir::SelectList
> > > Watir::Link
> > > Watir::Image
> > > Watir::TableCell
> > > Watir::TableRow
> > > Watir::TableBody
> > > Watir::TableBodies
> > > Watir::Table
> > > Watir::Label
> > > Watir::Span
> > > Watir::Div
> > > Watir::P
> > > Watir::SpanDivCommon
> > > 1.4.1
>
> > > C:\Suvo>gem list watir
>
> > > *** LOCAL GEMS ***
>
> > > watir (2.0.2)
> > > watir-webdriver (0.3.5, 0.3.4)
>
> > > C:\Suvo>
>
> > > still i have 1.4.1 on Watir::IE::VERSION
> > > here is my more deatils:
> > > ==
> > > C:\Suvo>ruby -v
> > > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
>
> > > C:\Suvo>gem -v
> > > 1.8.10
>
> > > C:\Suvo>gem list
>
> > > *** LOCAL GEMS ***
>
> > > activesupport (3.1.1)
> > > builder (3.0.0)
> > > child-process-manager (0.0.3)
> > > childprocess (0.2.2)
> > > commonwatir (2.0.2, 1.6.5)
> > > fattr (2.2.0)
> > > ffi (1.0.9)
> > > firewatir (1.9.4, 1.6.5)
> > > flexmock (0.9.0)
> > > hoe (2.12.3)
> > > json_pure (1.6.1)
> > > minitest (2.6.1)
> > > multi_json (1.0.3)
> > > rake (0.9.2)
> > > rautomation (0.6.3)
> > > rubygems-update (1.8.10, 1.8.9)
> > > rubyzip (0.9.4)
> > > s4t-utils (1.0.4)
> > > selenium-webdriver (2.7.0)
> > > session (3.1.0)
> > > user-choices (1.1.6.1)
> > > watir (2.0.2)
> > > watir-webdriver (0.3.5, 0.3.4)
> > > win32-api (1.4.8)
> > > win32-process (0.6.5)
> > > windows-api (0.4.0)
> > > windows-pr (1.2.1)
> > > xml-simple (1.1.0)
>
> > > thanks
>
> > > On Oct 11, 8:41 am, Joe DiMauro  wrote:
> > >> Babu,
>
> > >> I can see why you are confused as the value returned from the method
> > >> Watir::IE::VERSION does not match the version of the gem.
>
> > >> Watir::IE::VERSION gives you the version of the IE Browser.
> > >> Watir::VERSION gives you the version of Watir.
>
> > >> That said, here are some things to check:
> > >> 1. What versions of the gem are installed? You can have multiple
> > >> versions.
> > >> 2. Cleanup any unneeded version
> > >> 3. See what  is reported using Watir::IE:VERSION
> > >> 4. See what is reported using Watir::VERSION
>
> > >> Lets start with step 1.
> > >> Use the gem list command to see what versions are installed. For
> > >> example:
> > >>     C:\Users\Joe\workspace>gem list watir
>
> > >>     *** LOCAL GEMS ***
>
> > >>     watir (1.9.2, 1.6.5)
> > >>     watir-webdriver (0.3.5, 0.3.2)
>
> > >> Notice that it reports on any gem that contaisn "watir" in its name.
>
> > >> Step 2.
> > >> Now use the gem cleanup command to remove the old version.
> > >>     C:\Users\Joe\workspace>gem cleanup watir
> > >>     Cleaning up installed gems...
> > >>     Attempting to uninstall watir-1.6.5
> > >>     Successfully uninstalled watir-1.6.5
> > >>     Clean Up Complete
>
> > >> Recheck the versions
> > >>     C:\Users\Joe\workspace>gem list watir
>
> > >>     *** LOCAL GEMS ***
>
> > >>     watir (1.9.2)
> > >>     watir-webdriver (0.3.5, 0.3.2)
> > >>     watirworks (0.1.4)
>
> > >> Step 3.
> > >> Now that we know that only the Watir (1.9.2) em is installed lets look
> > >> at what Watir::IE::VERSION returns.
> > >>     C:\Users\Joe\workspace>irb
> > >>     irb(main):001:0> require 'watir'
> > >>     => true
> > >>     irb(main):002:0> Watir::IE::VERSION
> > >>     (irb):3: warning: toplevel constant VERSION referenced by
> > >> Watir::IE::VERSION
> > >>     => "1.8.7"
>
> > >> Hey that's the version of IE I have installed. Cool!
>
> > >> So now lets get the version of Watir:
> > >>     C:\Users\Joe\workspace>irb
> > >>     irb(main):001:0> require 'watir'
> > >>     => true
> > >>    irb(main):003:0> Watir::VERSION
> > >>    => "1.9.2"
>
> > >> And of course that matches the version of the installed gem!
>
> > >> Joe
>
> > >> On Oct 10, 11:49 am, Babu  wrote:
>
> > >> > i have already installed watir 1.6.5 in my gem list.
> > >> > But when i see the watir version as "ruby -e 'require "watir"; puts
> > >> > Watir::IE::VERSION'"
> > >> > it is showing 1.4.1
> > >> > how can i update to 1.6.5
> > >> > since i am not getting all the IE tags in 1.4.1 which is present in
> > >> > 1.6.5- Hide quoted text -
>
> > >> - Show quoted text -
>
> > > --
> > > Before posting, please readhttp://watir.com/support. In short: search
>
> > before you ask, be nice.
>
> > > watir-general@googlegroups.com

Re: [wtr-general] Re: Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Željko Filipin
On 11. 10. 2011., at 18:15, Joe Fl  wrote:
> undefined method `text_field' for nil:NilClass (NoMethodError)
>

That means @browser variable is not initialized, if I understood yourcode.


> Do I need the require 'watir' along with the require 'safariwatir'
> request in my script?

No. I am not sure that you can even install watir on mac.

Zeljko

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Cliff Cyphers
>> Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?
>>
>
> The main difficulty I have with this is that I've worked on a number
> of pages where part of the design requirements were that everything
> had to pretty much fit onto a specific default page size such as
> 1024x768, and if something was 'not in view' then I wanted the script
> to fail.  In that case having the script 'break' if something was
> outside that area is not a behavior I'd want to change.
>

It's still a good idea to be able to scroll to the required element,
although auto scrolling may be desired or unwanted depending on usage.
 In either case, you can always test your apps for such requirements
by:

1.  Resize browser to spec's dimensions.
2.  Call Browser::Element.in_viewable_area?

But other test which require clicking on the element's link would
still pass if the element was automatically scrolled to.  Why break
multiple test because the element isn't in a viewable area?  Have the
one test that check the speck as you mentioned and allow all of your
additional test which navigate the links and test other functionality
do their job, to find low hanging fruit faster.

just my 0.0001 cents

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Chuck van der Linden
On Oct 11, 9:07 am, Cliff Cyphers  wrote:
> Hello Watir users
>
 1.  The underlying selenium-webdriver can not perform an action on an
> element if it isn't in the viewable area on the browser.  Actions such
> as click, text, html, etc on such elements will fail under this
> condition.

> Seehttps://github.com/ccyphers/qa_robusta/blob/master/qa_observer/lib/wa...
> for a current implementation to handle these points.  Note, personally
> I think it might be best to make a slight update to this
> implementation, for the element not in the viewable area.  All method
> calls to Watir::Element which require the element to be in view, could
> first:
>
> Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?
>

The main difficulty I have with this is that I've worked on a number
of pages where part of the design requirements were that everything
had to pretty much fit onto a specific default page size such as
1024x768, and if something was 'not in view' then I wanted the script
to fail.  In that case having the script 'break' if something was
outside that area is not a behavior I'd want to change.

So if we make a change like this, then we might need some kind of a
global setting that would be used to enable or disable the automagical
scrolling of stuff into view.  That or is there a .viewable? method
that can be called to perform that check?  (yes, I'm being lazy and
asking you for info I could go look up)

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Cliff Cyphers
On Tue, Oct 11, 2011 at 11:27 AM, Jari Bakken  wrote:
>
> This is the intended default behaviour in WebDriver when you try to click an
> element. If you can provide an example of a case where this is failing,
> please open a bug in the Selenium tracker:
>   http://code.google.com/p/selenium/issues/entry

You mentioned elsewhere that this appears to be a bug with
chromedriver.  For the time being will use said work-around.

>
>>
>> Dealing with alert boxes you would now be able to do something like:
>> some_element.alert_box.text
>> some_element.alert_box.dismiss
>>
>
> Yes, we should replace the alert extension with an API that wraps
> WebDriver's alert handling. I don't think it makes sense to add the API to
> Element though, was that a typo?
>

Yes, that was a typo and should have been Watir::Browser

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Babu
if i uninstall ruby then i have to install all the  gems again
manually since in my office there is firewall issue so i download and
install all the gems manually.

On Oct 11, 11:12 am, Željko Filipin 
wrote:
> As I said, you probably have 1.4.1 installed from exe file. Uninstall ruby
> and install it again.
>
> Zeljko
>
>
>
>
>
> On Tuesday, October 11, 2011, Babu  wrote:
> > hi joe,
> > i did exactly what you told.
> > =
> > C:\Suvo>
> > Watir::FileField
> > Watir::Button
> > Watir::SelectList
> > Watir::Link
> > Watir::Image
> > Watir::TableCell
> > Watir::TableRow
> > Watir::TableBody
> > Watir::TableBodies
> > Watir::Table
> > Watir::Label
> > Watir::Span
> > Watir::Div
> > Watir::P
> > Watir::SpanDivCommon
> > 1.4.1
>
> > C:\Suvo>gem list watir
>
> > *** LOCAL GEMS ***
>
> > watir (2.0.2)
> > watir-webdriver (0.3.5, 0.3.4)
>
> > C:\Suvo>
>
> > still i have 1.4.1 on Watir::IE::VERSION
> > here is my more deatils:
> > ==
> > C:\Suvo>ruby -v
> > ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
>
> > C:\Suvo>gem -v
> > 1.8.10
>
> > C:\Suvo>gem list
>
> > *** LOCAL GEMS ***
>
> > activesupport (3.1.1)
> > builder (3.0.0)
> > child-process-manager (0.0.3)
> > childprocess (0.2.2)
> > commonwatir (2.0.2, 1.6.5)
> > fattr (2.2.0)
> > ffi (1.0.9)
> > firewatir (1.9.4, 1.6.5)
> > flexmock (0.9.0)
> > hoe (2.12.3)
> > json_pure (1.6.1)
> > minitest (2.6.1)
> > multi_json (1.0.3)
> > rake (0.9.2)
> > rautomation (0.6.3)
> > rubygems-update (1.8.10, 1.8.9)
> > rubyzip (0.9.4)
> > s4t-utils (1.0.4)
> > selenium-webdriver (2.7.0)
> > session (3.1.0)
> > user-choices (1.1.6.1)
> > watir (2.0.2)
> > watir-webdriver (0.3.5, 0.3.4)
> > win32-api (1.4.8)
> > win32-process (0.6.5)
> > windows-api (0.4.0)
> > windows-pr (1.2.1)
> > xml-simple (1.1.0)
>
> > thanks
>
> > On Oct 11, 8:41 am, Joe DiMauro  wrote:
> >> Babu,
>
> >> I can see why you are confused as the value returned from the method
> >> Watir::IE::VERSION does not match the version of the gem.
>
> >> Watir::IE::VERSION gives you the version of the IE Browser.
> >> Watir::VERSION gives you the version of Watir.
>
> >> That said, here are some things to check:
> >> 1. What versions of the gem are installed? You can have multiple
> >> versions.
> >> 2. Cleanup any unneeded version
> >> 3. See what  is reported using Watir::IE:VERSION
> >> 4. See what is reported using Watir::VERSION
>
> >> Lets start with step 1.
> >> Use the gem list command to see what versions are installed. For
> >> example:
> >>     C:\Users\Joe\workspace>gem list watir
>
> >>     *** LOCAL GEMS ***
>
> >>     watir (1.9.2, 1.6.5)
> >>     watir-webdriver (0.3.5, 0.3.2)
>
> >> Notice that it reports on any gem that contaisn "watir" in its name.
>
> >> Step 2.
> >> Now use the gem cleanup command to remove the old version.
> >>     C:\Users\Joe\workspace>gem cleanup watir
> >>     Cleaning up installed gems...
> >>     Attempting to uninstall watir-1.6.5
> >>     Successfully uninstalled watir-1.6.5
> >>     Clean Up Complete
>
> >> Recheck the versions
> >>     C:\Users\Joe\workspace>gem list watir
>
> >>     *** LOCAL GEMS ***
>
> >>     watir (1.9.2)
> >>     watir-webdriver (0.3.5, 0.3.2)
> >>     watirworks (0.1.4)
>
> >> Step 3.
> >> Now that we know that only the Watir (1.9.2) em is installed lets look
> >> at what Watir::IE::VERSION returns.
> >>     C:\Users\Joe\workspace>irb
> >>     irb(main):001:0> require 'watir'
> >>     => true
> >>     irb(main):002:0> Watir::IE::VERSION
> >>     (irb):3: warning: toplevel constant VERSION referenced by
> >> Watir::IE::VERSION
> >>     => "1.8.7"
>
> >> Hey that's the version of IE I have installed. Cool!
>
> >> So now lets get the version of Watir:
> >>     C:\Users\Joe\workspace>irb
> >>     irb(main):001:0> require 'watir'
> >>     => true
> >>    irb(main):003:0> Watir::VERSION
> >>    => "1.9.2"
>
> >> And of course that matches the version of the installed gem!
>
> >> Joe
>
> >> On Oct 10, 11:49 am, Babu  wrote:
>
> >> > i have already installed watir 1.6.5 in my gem list.
> >> > But when i see the watir version as "ruby -e 'require "watir"; puts
> >> > Watir::IE::VERSION'"
> >> > it is showing 1.4.1
> >> > how can i update to 1.6.5
> >> > since i am not getting all the IE tags in 1.4.1 which is present in
> >> > 1.6.5- Hide quoted text -
>
> >> - Show quoted text -
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
>
> before you ask, be nice.
>
>
>
>
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: waiting using implicit_wait with watir-webdriver

2011-10-11 Thread Chuck van der Linden
It's a thorny issue.  in the 'old days' most automation apps I used
had a wait/timeout parameter on nearly every action you could take,
and it was needed because very often a UI would get slow in places or
there were times that background processing was happening.  Staying
'synced up' with the UI was a big issue and someone hoping to make any
effective use of a tool like winrunner had to learn how to do that.

In the web 1.0 era this was not nearly so big of an issue because you
could basically just wait till the browser was done loading the page,
and go on with the script.  Watir was designed in this era and thus (I
believe) there was no thought to having a consistent way to 'wait for
things to be right'.  Simply waiting for the browser to finish loading
the page was all you needed to do, and Watir is designed around this.

In the web 2.0+ era we are seeing more and more pages that load and do
things in an async manner, or have huge amounts of client side code
that runs as/after the page loads to put it in the proper form,
perform CSS magic, set element states like hidden/displayed/enabled,
relocate stuff on the screen etc.  In addition we have a lot of client
side code such as many functions availble via Jquery and 3rd party
tools that interact directly with the webserver and refresh partial
portions of the page __without__ doing a page load.  All of this makes
waiting and 'syncing' to the UI an issue again on a lot of sites where
these things are happening and you have one of two situations
 1) the page is NOT ready the instant that the browser finishes
pulling data from the server, and needs a moment to process client
side code
 2) Data is fetched and the page updated by client side code and the
browser never goes into a 'loading' mode, and again time is needed for
the data to be retrieved and portions of the page to re-render.

The global implicit wait is thus a very tempting solution for someone
faced with a lot of timing issues due to modern client side heavy web
page design.  I can understand the attraction.  Although I have to
agree that it opens up a pretty big 'can of worms' as it were and has
a downside.  The problem is that the alternative of constantly having
to invoke tactics from 'how to wait with watir' is somewhat
cumbersome, and with a 1 second granularity can cause a a significant
aggregate increase in execution time for scripts when there is a lot
of waiting needed.  and unless I'm confused, if you COMBINE implicit
and explicit waits, then you may be faced with a multipler effect
where a loop you intended to wait 10 seconds, if run with a 5 second
implicit wait, ends up waiting 50 seconds.

We've been dealing with it in a sort of as needed patchwork way,
implementing a few methods with concepts like 'when present'  but that
solution is also a bit cumbersome.  It causes me to wonder if for a
2.5 or 3.0 version of the api we need to add the idea of an additional
parameter on most methods that would be a wait time (and have it
default to zero if not present), or if we would need to create
'_when_present' varients for nearly all methods/objects

In the meantime, the best recommendation I can make is for people to
work with their devs to make this kind of thing easier to test.  What
I've found to work is some kind of handy semiphore that can be used to
tell when client side code is waiting, and when the page is ready.  In
this respect, I recommend the use of a 'working/loading' graphic
(usually an animated image) that is displayed first thing & hidden
last thing, whenever client side code is running.  If this element has
the same ID (or it's in a container with a consistent ID) then that
makes it very easy to create a method that waits for that element to
go to a hidden state and just call that method whenever you know you
need to wait for client side code to finish doing its thing.  You can
have your method take a parameter which is a 'number of seconds to
wait' use a loop with a 1 second sleep, that exits once the element is
in the hidden state or the max loop count reached.



On Oct 9, 10:17 am, Jarmo Pertman  wrote:
> I'd have to agree with Jari on this.
>
> Jarmo Pertman
> -
> IT does really matter -http://itreallymatters.net
>
> On Oct 5, 2:43 pm, Jari Bakken  wrote:
>
>
>
>
>
>
>
> > I usually prefer waiting explicitly (especially since watir-webdriver makes
> > it so easy) and never use implicit waits. Implicit waits hide information
> > about app behaviour from test developers that I think is often quite
> > relevant, and slows down your tests when (a) you want to check that an
> > element is missing or (b) the missing element is an application bug and
> > should fail immediately.
>
> > It'd be useful if the waiting page on the web site could separate a bit
> > between the two approaches. Combining them is not always pleasant, see 
> > e.g.https://groups.google.com/forum/#!topic/selenium-developers/91vSZHxAnCg
>
> > Jari
>
> > On Wed, Oct 5, 2011 at 1:27 PM, Alister Scott 
> >

Re: [wtr-general] watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Jari Bakken
On Tue, Oct 11, 2011 at 6:07 PM, Cliff Cyphers wrote:

> Hello Watir users
>
> I wanted to write the watir-general community and inquire about how
> much pain you feel around what appears to be some common items that
> might need to be added to watir-webdriver.
>
> 1.  The underlying selenium-webdriver can not perform an action on an
> element if it isn't in the viewable area on the browser.  Actions such
> as click, text, html, etc on such elements will fail under this
> condition.
> 2.  The code for handling alert boxes seams to be very flaky on
> certain OS/browser combinations.
> 3.  fire_event('mouseover') doesn't work on all OS/browser combinations
>
> All of these aspects can easily be updated to make your life easier.
> Updates to handle each of these aspects are included in qa_robusta,
> which has previously been mentioned on the list.  If you feel that
> these features are valuable, there's a better chance they will get
> incorporated into the main release of watir-webdriver if you voice
> your opinion.
>
> See
> https://github.com/ccyphers/qa_robusta/blob/master/qa_observer/lib/watir.rb
> for a current implementation to handle these points.  Note, personally
> I think it might be best to make a slight update to this
> implementation, for the element not in the viewable area.  All method
> calls to Watir::Element which require the element to be in view, could
> first:
>
> Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?
>


This is the intended default behaviour in WebDriver when you try to click an
element. If you can provide an example of a case where this is failing,
please open a bug in the Selenium tracker:

  http://code.google.com/p/selenium/issues/entry


>
> Dealing with alert boxes you would now be able to do something like:
> some_element.alert_box.text
> some_element.alert_box.dismiss
>
>
Yes, we should replace the alert extension with an API that wraps
WebDriver's alert handling. I don't think it makes sense to add the API to
Element though, was that a typo?



> For mouseovering an element, you no longer would need to call
> fire_event, which is unreliable.  You could simply:
> some_element.mouseover
>
> Thank you for your comments
> Cliff.
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Joe Fl
Hi Zeljko,

I made the changes use suggested and got the following error:

undefined method `text_field' for nil:NilClass (NoMethodError)

Do I need the require 'watir' along with the require 'safariwatir'
request in my script?

Thank you,
Joe

On Oct 11, 11:11 am, Željko Filipin 
wrote:
> I think safariwatir does not support hashrocket syntax
>
> browser.element(how => what)
>
> You have to use
>
> browser.element(how, what)
>
> Zeljko
>
>
>
>
>
>
>
>
>
> On Tuesday, October 11, 2011, Joe Fl  wrote:
> > Hello,
>
> > I am receiving the following error message:
>
> > in `text_field': wrong number of arguments (1 for 2) (ArgumentError)
> >        from /Users/josephfleck/Documents/workspace/test/helper_methods.rb:
> > 32:in `login'
> >        from /Users/josephfleck/Documents/workspace/test/
> > Add_Discussion_Safari.rb:27
>
> > I have created a helper class for the actions that will be done over
> > and over.  I created the script in Firefox and it works fine there but
> > when I run it with require "safariwatir" it crashes once it reaches
> > the text_box field.
>
> > Code from script:
>
> > # the rubygems
> > require "rubygems"
>
> > # Safariwatir controller
> > require "safariwatir"
>
> > #Open Class tab navigation
> > require 'tab_navigation'
>
> > #require 'LogOut.rb'
> > require 'helper_methods'
>
> > test_site = "http://0.0.0.0:3000/public/sign_in";
> > user_Ideer = "mber...@within3.com"
> > user_pswd = "abcd1234"
>
> > #open browser
> > puts "Open Safari and Url"
> > #
> > $browser = Watir::Safari.start(""+test_site+"")
>
> > # < Login helper >
> > lgo = Helper_methods.new($browser)
> > lgo.login(user_Ideer,user_pswd)
>
> > Code from helper:
>
> >  def initialize(browser)
> >    @browser = browser
> >  end
>
> >  #<<< Login Method >>>
> >  def login(user_Ideer,user_pswd)
>
> >    puts "Email :#{user_Ideer}, Password : #{user_pswd}"
>
> >    #open browser
> > #    puts "Open Firefox and Url"
> > #    $browser = Watir::Browser.start(""+test_site+"")
>
> >    #Typing in user name into User Name field
> >    puts "Key in correct username."
> >    @browser.text_field(:name =>'username').set user_Ideer
>
> >    #Typing in password into Password field
> >    puts "Key in correct password."
> >    @browser.text_field(:name =>'password').set user_pswd
>
> >    #Click in Sign In button
> >    puts "Click the sign in Button"
> >    @browser.button(:id =>'sign_in_button').click
>
> >  end
>
> > Any help would be appreciated.
>
> > Thank you,
> > Joe
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
>
> before you ask, be nice.
>
>
>
>
>
>
>
>
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] watir-webdriver survey for adding items such as: alert_box, scroll_to, and in_viewable_area?

2011-10-11 Thread Cliff Cyphers
Hello Watir users

I wanted to write the watir-general community and inquire about how
much pain you feel around what appears to be some common items that
might need to be added to watir-webdriver.

1.  The underlying selenium-webdriver can not perform an action on an
element if it isn't in the viewable area on the browser.  Actions such
as click, text, html, etc on such elements will fail under this
condition.
2.  The code for handling alert boxes seams to be very flaky on
certain OS/browser combinations.
3.  fire_event('mouseover') doesn't work on all OS/browser combinations

All of these aspects can easily be updated to make your life easier.
Updates to handle each of these aspects are included in qa_robusta,
which has previously been mentioned on the list.  If you feel that
these features are valuable, there's a better chance they will get
incorporated into the main release of watir-webdriver if you voice
your opinion.

See https://github.com/ccyphers/qa_robusta/blob/master/qa_observer/lib/watir.rb
for a current implementation to handle these points.  Note, personally
I think it might be best to make a slight update to this
implementation, for the element not in the viewable area.  All method
calls to Watir::Element which require the element to be in view, could
first:

Watir::Element#scroll_to unless unless Watir::Element#in_viewable_area?

Dealing with alert boxes you would now be able to do something like:
some_element.alert_box.text
some_element.alert_box.dismiss

For mouseovering an element, you no longer would need to call
fire_event, which is unreliable.  You could simply:
some_element.mouseover

Thank you for your comments
Cliff.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] confused with versioning in Watir

2011-10-11 Thread Željko Filipin
As I said, you probably have 1.4.1 installed from exe file. Uninstall ruby
and install it again.

Zeljko

On Tuesday, October 11, 2011, Babu  wrote:
> hi joe,
> i did exactly what you told.
> =
> C:\Suvo>
> Watir::FileField
> Watir::Button
> Watir::SelectList
> Watir::Link
> Watir::Image
> Watir::TableCell
> Watir::TableRow
> Watir::TableBody
> Watir::TableBodies
> Watir::Table
> Watir::Label
> Watir::Span
> Watir::Div
> Watir::P
> Watir::SpanDivCommon
> 1.4.1
>
> C:\Suvo>gem list watir
>
> *** LOCAL GEMS ***
>
> watir (2.0.2)
> watir-webdriver (0.3.5, 0.3.4)
>
> C:\Suvo>
>
> still i have 1.4.1 on Watir::IE::VERSION
> here is my more deatils:
> ==
> C:\Suvo>ruby -v
> ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
>
> C:\Suvo>gem -v
> 1.8.10
>
> C:\Suvo>gem list
>
> *** LOCAL GEMS ***
>
> activesupport (3.1.1)
> builder (3.0.0)
> child-process-manager (0.0.3)
> childprocess (0.2.2)
> commonwatir (2.0.2, 1.6.5)
> fattr (2.2.0)
> ffi (1.0.9)
> firewatir (1.9.4, 1.6.5)
> flexmock (0.9.0)
> hoe (2.12.3)
> json_pure (1.6.1)
> minitest (2.6.1)
> multi_json (1.0.3)
> rake (0.9.2)
> rautomation (0.6.3)
> rubygems-update (1.8.10, 1.8.9)
> rubyzip (0.9.4)
> s4t-utils (1.0.4)
> selenium-webdriver (2.7.0)
> session (3.1.0)
> user-choices (1.1.6.1)
> watir (2.0.2)
> watir-webdriver (0.3.5, 0.3.4)
> win32-api (1.4.8)
> win32-process (0.6.5)
> windows-api (0.4.0)
> windows-pr (1.2.1)
> xml-simple (1.1.0)
>
>
>
>
>
> thanks
>
>
> On Oct 11, 8:41 am, Joe DiMauro  wrote:
>> Babu,
>>
>> I can see why you are confused as the value returned from the method
>> Watir::IE::VERSION does not match the version of the gem.
>>
>> Watir::IE::VERSION gives you the version of the IE Browser.
>> Watir::VERSION gives you the version of Watir.
>>
>> That said, here are some things to check:
>> 1. What versions of the gem are installed? You can have multiple
>> versions.
>> 2. Cleanup any unneeded version
>> 3. See what  is reported using Watir::IE:VERSION
>> 4. See what is reported using Watir::VERSION
>>
>> Lets start with step 1.
>> Use the gem list command to see what versions are installed. For
>> example:
>> C:\Users\Joe\workspace>gem list watir
>>
>> *** LOCAL GEMS ***
>>
>> watir (1.9.2, 1.6.5)
>> watir-webdriver (0.3.5, 0.3.2)
>>
>> Notice that it reports on any gem that contaisn "watir" in its name.
>>
>> Step 2.
>> Now use the gem cleanup command to remove the old version.
>> C:\Users\Joe\workspace>gem cleanup watir
>> Cleaning up installed gems...
>> Attempting to uninstall watir-1.6.5
>> Successfully uninstalled watir-1.6.5
>> Clean Up Complete
>>
>> Recheck the versions
>> C:\Users\Joe\workspace>gem list watir
>>
>> *** LOCAL GEMS ***
>>
>> watir (1.9.2)
>> watir-webdriver (0.3.5, 0.3.2)
>> watirworks (0.1.4)
>>
>> Step 3.
>> Now that we know that only the Watir (1.9.2) em is installed lets look
>> at what Watir::IE::VERSION returns.
>> C:\Users\Joe\workspace>irb
>> irb(main):001:0> require 'watir'
>> => true
>> irb(main):002:0> Watir::IE::VERSION
>> (irb):3: warning: toplevel constant VERSION referenced by
>> Watir::IE::VERSION
>> => "1.8.7"
>>
>> Hey that's the version of IE I have installed. Cool!
>>
>> So now lets get the version of Watir:
>> C:\Users\Joe\workspace>irb
>> irb(main):001:0> require 'watir'
>> => true
>>irb(main):003:0> Watir::VERSION
>>=> "1.9.2"
>>
>> And of course that matches the version of the installed gem!
>>
>> Joe
>>
>> On Oct 10, 11:49 am, Babu  wrote:
>>
>>
>>
>> > i have already installed watir 1.6.5 in my gem list.
>> > But when i see the watir version as "ruby -e 'require "watir"; puts
>> > Watir::IE::VERSION'"
>> > it is showing 1.4.1
>> > how can i update to 1.6.5
>> > since i am not getting all the IE tags in 1.4.1 which is present in
>> > 1.6.5- Hide quoted text -
>>
>> - Show quoted text -
>
> --
> Before posting, please read http://watir.com/support. In short: search
before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Željko Filipin
I think safariwatir does not support hashrocket syntax

browser.element(how => what)

You have to use

browser.element(how, what)

Zeljko

On Tuesday, October 11, 2011, Joe Fl  wrote:
> Hello,
>
> I am receiving the following error message:
>
> in `text_field': wrong number of arguments (1 for 2) (ArgumentError)
>from /Users/josephfleck/Documents/workspace/test/helper_methods.rb:
> 32:in `login'
>from /Users/josephfleck/Documents/workspace/test/
> Add_Discussion_Safari.rb:27
>
> I have created a helper class for the actions that will be done over
> and over.  I created the script in Firefox and it works fine there but
> when I run it with require "safariwatir" it crashes once it reaches
> the text_box field.
>
> Code from script:
>
> # the rubygems
> require "rubygems"
>
> # Safariwatir controller
> require "safariwatir"
>
> #Open Class tab navigation
> require 'tab_navigation'
>
> #require 'LogOut.rb'
> require 'helper_methods'
>
> test_site = "http://0.0.0.0:3000/public/sign_in";
> user_Ideer = "mber...@within3.com"
> user_pswd = "abcd1234"
>
> #open browser
> puts "Open Safari and Url"
> #
> $browser = Watir::Safari.start(""+test_site+"")
>
> # < Login helper >
> lgo = Helper_methods.new($browser)
> lgo.login(user_Ideer,user_pswd)
>
>
> Code from helper:
>
>  def initialize(browser)
>@browser = browser
>  end
>
>  #<<< Login Method >>>
>  def login(user_Ideer,user_pswd)
>
>puts "Email :#{user_Ideer}, Password : #{user_pswd}"
>
>#open browser
> #puts "Open Firefox and Url"
> #$browser = Watir::Browser.start(""+test_site+"")
>
>#Typing in user name into User Name field
>puts "Key in correct username."
>@browser.text_field(:name =>'username').set user_Ideer
>
>#Typing in password into Password field
>puts "Key in correct password."
>@browser.text_field(:name =>'password').set user_pswd
>
>#Click in Sign In button
>puts "Click the sign in Button"
>@browser.button(:id =>'sign_in_button').click
>
>  end
>
>
> Any help would be appreciated.
>
> Thank you,
> Joe
>
> --
> Before posting, please read http://watir.com/support. In short: search
before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Babu
hi joe,
i did exactly what you told.
=
C:\Suvo>
Watir::FileField
Watir::Button
Watir::SelectList
Watir::Link
Watir::Image
Watir::TableCell
Watir::TableRow
Watir::TableBody
Watir::TableBodies
Watir::Table
Watir::Label
Watir::Span
Watir::Div
Watir::P
Watir::SpanDivCommon
1.4.1

C:\Suvo>gem list watir

*** LOCAL GEMS ***

watir (2.0.2)
watir-webdriver (0.3.5, 0.3.4)

C:\Suvo>

still i have 1.4.1 on Watir::IE::VERSION
here is my more deatils:
==
C:\Suvo>ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]

C:\Suvo>gem -v
1.8.10

C:\Suvo>gem list

*** LOCAL GEMS ***

activesupport (3.1.1)
builder (3.0.0)
child-process-manager (0.0.3)
childprocess (0.2.2)
commonwatir (2.0.2, 1.6.5)
fattr (2.2.0)
ffi (1.0.9)
firewatir (1.9.4, 1.6.5)
flexmock (0.9.0)
hoe (2.12.3)
json_pure (1.6.1)
minitest (2.6.1)
multi_json (1.0.3)
rake (0.9.2)
rautomation (0.6.3)
rubygems-update (1.8.10, 1.8.9)
rubyzip (0.9.4)
s4t-utils (1.0.4)
selenium-webdriver (2.7.0)
session (3.1.0)
user-choices (1.1.6.1)
watir (2.0.2)
watir-webdriver (0.3.5, 0.3.4)
win32-api (1.4.8)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.2.1)
xml-simple (1.1.0)





thanks


On Oct 11, 8:41 am, Joe DiMauro  wrote:
> Babu,
>
> I can see why you are confused as the value returned from the method
> Watir::IE::VERSION does not match the version of the gem.
>
> Watir::IE::VERSION gives you the version of the IE Browser.
> Watir::VERSION gives you the version of Watir.
>
> That said, here are some things to check:
> 1. What versions of the gem are installed? You can have multiple
> versions.
> 2. Cleanup any unneeded version
> 3. See what  is reported using Watir::IE:VERSION
> 4. See what is reported using Watir::VERSION
>
> Lets start with step 1.
> Use the gem list command to see what versions are installed. For
> example:
>     C:\Users\Joe\workspace>gem list watir
>
>     *** LOCAL GEMS ***
>
>     watir (1.9.2, 1.6.5)
>     watir-webdriver (0.3.5, 0.3.2)
>
> Notice that it reports on any gem that contaisn "watir" in its name.
>
> Step 2.
> Now use the gem cleanup command to remove the old version.
>     C:\Users\Joe\workspace>gem cleanup watir
>     Cleaning up installed gems...
>     Attempting to uninstall watir-1.6.5
>     Successfully uninstalled watir-1.6.5
>     Clean Up Complete
>
> Recheck the versions
>     C:\Users\Joe\workspace>gem list watir
>
>     *** LOCAL GEMS ***
>
>     watir (1.9.2)
>     watir-webdriver (0.3.5, 0.3.2)
>     watirworks (0.1.4)
>
> Step 3.
> Now that we know that only the Watir (1.9.2) em is installed lets look
> at what Watir::IE::VERSION returns.
>     C:\Users\Joe\workspace>irb
>     irb(main):001:0> require 'watir'
>     => true
>     irb(main):002:0> Watir::IE::VERSION
>     (irb):3: warning: toplevel constant VERSION referenced by
> Watir::IE::VERSION
>     => "1.8.7"
>
> Hey that's the version of IE I have installed. Cool!
>
> So now lets get the version of Watir:
>     C:\Users\Joe\workspace>irb
>     irb(main):001:0> require 'watir'
>     => true
>    irb(main):003:0> Watir::VERSION
>    => "1.9.2"
>
> And of course that matches the version of the installed gem!
>
> Joe
>
> On Oct 10, 11:49 am, Babu  wrote:
>
>
>
> > i have already installed watir 1.6.5 in my gem list.
> > But when i see the watir version as "ruby -e 'require "watir"; puts
> > Watir::IE::VERSION'"
> > it is showing 1.4.1
> > how can i update to 1.6.5
> > since i am not getting all the IE tags in 1.4.1 which is present in
> > 1.6.5- Hide quoted text -
>
> - Show quoted text -

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Trying to use SafariWatir and receiving an error when keying value into a text_field

2011-10-11 Thread Joe Fl
Hello,

I am receiving the following error message:

in `text_field': wrong number of arguments (1 for 2) (ArgumentError)
from /Users/josephfleck/Documents/workspace/test/helper_methods.rb:
32:in `login'
from /Users/josephfleck/Documents/workspace/test/
Add_Discussion_Safari.rb:27

I have created a helper class for the actions that will be done over
and over.  I created the script in Firefox and it works fine there but
when I run it with require "safariwatir" it crashes once it reaches
the text_box field.

Code from script:

# the rubygems
require "rubygems"

# Safariwatir controller
require "safariwatir"

#Open Class tab navigation
require 'tab_navigation'

#require 'LogOut.rb'
require 'helper_methods'

test_site = "http://0.0.0.0:3000/public/sign_in";
user_Ideer = "mber...@within3.com"
user_pswd = "abcd1234"

#open browser
puts "Open Safari and Url"
#
$browser = Watir::Safari.start(""+test_site+"")

# < Login helper >
lgo = Helper_methods.new($browser)
lgo.login(user_Ideer,user_pswd)


Code from helper:

 def initialize(browser)
@browser = browser
  end

  #<<< Login Method >>>
  def login(user_Ideer,user_pswd)

puts "Email :#{user_Ideer}, Password : #{user_pswd}"

#open browser
#puts "Open Firefox and Url"
#$browser = Watir::Browser.start(""+test_site+"")

#Typing in user name into User Name field
puts "Key in correct username."
@browser.text_field(:name =>'username').set user_Ideer

#Typing in password into Password field
puts "Key in correct password."
@browser.text_field(:name =>'password').set user_pswd

#Click in Sign In button
puts "Click the sign in Button"
@browser.button(:id =>'sign_in_button').click

  end


Any help would be appreciated.

Thank you,
Joe

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: confused with versioning in Watir

2011-10-11 Thread Joe DiMauro
Babu,

I can see why you are confused as the value returned from the method
Watir::IE::VERSION does not match the version of the gem.

Watir::IE::VERSION gives you the version of the IE Browser.
Watir::VERSION gives you the version of Watir.

That said, here are some things to check:
1. What versions of the gem are installed? You can have multiple
versions.
2. Cleanup any unneeded version
3. See what  is reported using Watir::IE:VERSION
4. See what is reported using Watir::VERSION

Lets start with step 1.
Use the gem list command to see what versions are installed. For
example:
C:\Users\Joe\workspace>gem list watir

*** LOCAL GEMS ***

watir (1.9.2, 1.6.5)
watir-webdriver (0.3.5, 0.3.2)

Notice that it reports on any gem that contaisn "watir" in its name.

Step 2.
Now use the gem cleanup command to remove the old version.
C:\Users\Joe\workspace>gem cleanup watir
Cleaning up installed gems...
Attempting to uninstall watir-1.6.5
Successfully uninstalled watir-1.6.5
Clean Up Complete

Recheck the versions
C:\Users\Joe\workspace>gem list watir

*** LOCAL GEMS ***

watir (1.9.2)
watir-webdriver (0.3.5, 0.3.2)
watirworks (0.1.4)

Step 3.
Now that we know that only the Watir (1.9.2) em is installed lets look
at what Watir::IE::VERSION returns.
C:\Users\Joe\workspace>irb
irb(main):001:0> require 'watir'
=> true
irb(main):002:0> Watir::IE::VERSION
(irb):3: warning: toplevel constant VERSION referenced by
Watir::IE::VERSION
=> "1.8.7"

Hey that's the version of IE I have installed. Cool!

So now lets get the version of Watir:
C:\Users\Joe\workspace>irb
irb(main):001:0> require 'watir'
=> true
   irb(main):003:0> Watir::VERSION
   => "1.9.2"

And of course that matches the version of the installed gem!

Joe

On Oct 10, 11:49 am, Babu  wrote:
> i have already installed watir 1.6.5 in my gem list.
> But when i see the watir version as "ruby -e 'require "watir"; puts
> Watir::IE::VERSION'"
> it is showing 1.4.1
> how can i update to 1.6.5
> since i am not getting all the IE tags in 1.4.1 which is present in
> 1.6.5

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com