Re: [wtr-general] Re: Recent Stack Overflow Questions Tagged Watir

2011-03-21 Thread Željko Filipin
http://stackoverflow.com/questions/5359556/unable-to-find-method-for-detecting-if-element-exists-on-a-page
http://stackoverflow.com/questions/5358518/how-to-detect-if-an-element-exists-in-watir

-- 
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] Multiple browsers

2011-03-21 Thread Aravind
Hi

My scripts clicks on logout link to logout the app and close it.
Once the main browser closes, one more broser will open with some message.
I have to click on a link to close the second browser.

Can any one please help in clicking the link in the other browser.

thanks
aravind

-- 
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] Multiple browsers

2011-03-21 Thread Željko Filipin
On Mon, Mar 21, 2011 at 12:41 PM, Aravind  wrote:
> Can any one please help in clicking the link in the other browser.

I guess you are asking how to attach to another browser window?

http://wiki.openqa.org/display/WTR/New+Browser+Windows

Željko
--
watir.com - community manager
watir.com/book - author
viaqa.mobi conference on software testing - organizer
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

-- 
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] Multiple browsers

2011-03-21 Thread Aravind
thanks Filipin

My second browser opens after the first one closes.
I wanted to click on a link in the second browser.

Please let me know how to handle this.

thanks
aravind



On Mon, Mar 21, 2011 at 5:14 PM, Željko Filipin <
zeljko.fili...@wa-research.ch> wrote:

> On Mon, Mar 21, 2011 at 12:41 PM, Aravind 
> wrote:
> > Can any one please help in clicking the link in the other browser.
>
> I guess you are asking how to attach to another browser window?
>
> http://wiki.openqa.org/display/WTR/New+Browser+Windows
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> viaqa.mobi conference on software testing - organizer
> watirpodcast.com - host
> testingpodcast.com - audio podcasts on software testing. all of them
>
>
> --
> 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] Multiple browsers

2011-03-21 Thread Željko Filipin
On Mon, Mar 21, 2011 at 1:04 PM, Aravind  wrote:
> My second browser opens after the first one closes.
> I wanted to click on a link in the second browser.

Attach to it and then click the link. Read the page I have previously linked
to and let me know if you still do not know what to do.

Željko

-- 
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] Multiple browsers

2011-03-21 Thread Aravind
Thanks Filipin

Its working

\below is the code

ie2 = Watir::IE.attach(:title,'welcome')
ie2.send_keys('{TAB}') // As I have only one link in the page
ie2.send_keys('{ENTER}')

thanks
aravind



On Mon, Mar 21, 2011 at 5:37 PM, Željko Filipin <
zeljko.fili...@wa-research.ch> wrote:

> On Mon, Mar 21, 2011 at 1:04 PM, Aravind  wrote:
> > My second browser opens after the first one closes.
> > I wanted to click on a link in the second browser.
>
> Attach to it and then click the link. Read the page I have previously
> linked to and let me know if you still do not know what to do.
>
> Željko
>
> --
> 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] Multiple browsers

2011-03-21 Thread Željko Filipin
On Mon, Mar 21, 2011 at 1:26 PM, Aravind  wrote:
> ie2.send_keys('{TAB}') // As I have only one link in the page
> ie2.send_keys('{ENTER}')

If you are attaching to regular browser window, there is no need for
send_keys, you should use something like this:

browser.link(how, what).click

Example:

browser.link(:index => 1).click

Željko

-- 
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: Output to xls or .cvs file

2011-03-21 Thread Dave McNulla
I would find what is nil. check line 78 of your ffscript to see what is 
happening there.

On a side note, I would restructure the loop you are using.

this is assuming that the a array has 30 elements or that you always want to 
process only 30 elements.
for x in 0..30 do 
  ff.div(:id, a[x]).fireEvent("onmouseup") 
end

If you want to get every element, you could never worry about size changes 
to Array a if you did this:
a.each { |x| 
ff.div(:id, x).fireEvent("onmouseup")
}

Goodluck,

Dave

-- 
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: Measure response time with fireEvent("onmouseup")

2011-03-21 Thread Chuck van der Linden
Yeah, if it's not reloading the entire page that Watir is not going to
automatically give you a time

And getting an exact time is going to be very tricky since as far as I
know watir can only sleep in whole second increments.  So if you
devise some kind of loop that waits for a particular element to be
present, you are not going to get performance numbers that mean much.

You're probably still going to need to devise a means to tell when
it's done updating the page, and wait for that to happen before the
script proceeds.  But performance metrics will have to come from an
outside source, such as fiddler or some other monitor looking at the
HTTP traffic.

On Mar 18, 3:42 am, vin  wrote:
> Hi Chuck,
>
> Please find my below response:
>
> >>Have you by any chance tried to click that div as if it was a button,
>
>  using the ID to identify it?
> Yes, but its not clicking on that object.>>system truely re-loading the page, 
> or is it just updating it?
>
> Since its extjs, it is only updating the page.>>does it ever say anything but 
> 'done' in the status bar?
>
> Only "done". Also i tried button click along with fireevent as
> suggested but the ouptut is same.
>
> Tim:
> Those plugin are from httpwatch tool.
>
> As Chuck suggested, I will dig in and try to use waiting option.
>
> Thanks,
>
> On Mar 17, 10:17 pm, Chuck van der Linden  wrote:
>
> > I think the issue is that since it's being invoked by client-side
> > code, watir doesn't really know to expect a page load at that time
>
> > Have you by any chance tried to click that div as if it was a button,
> > using the ID to identify it?
>
> > Since I see some ajax in there, I guess the first question is, is the
> > system truely re-loading the page, or is it just updating it?  In
> > other words, does the browser actually act like a page is loading,
> > does it ever say anything but 'done' in the status bar?  do you see
> > any of the 'animations' done by the browser to indicate a page is
> > being loaded?   If it is only updating portions of the page, it makes
> > getting a load time a lot harder.
>
> > It's been a while since I've played with this (since I needed to) but
> > I could swear that in the past Watir was a little less obsessive about
> > elements exactly matching the specific element type when you were
> > identifying them by ID (I think the logic was that since there should
> > be only ONE thing on that page with that id value, if we found one, it
> > must be the one you wanted).
>
> > b.button(:id, "configure_access_left").click
>
> > The reason I say that is that doing that might cause watir to do it's
> > normal 'wait for the page to load' thing.   I'm not sure, but it might
> > be worth a shot.
>
> > (that or adding that command right after the one that does the mouseup
> > event, instead of a sleep)
>
> > Instead of sleeps, read up on waiting with watir.. in cases like this
> > it's sometimes easier to just have a small loop that waits for a
> > expected object to exist within the page, as an indication you are
> > ready to proceed.  (or conversely if the app displays some kind of
> > 'loading' icon, you wait for that to go away)
>
> > On Mar 17, 3:29 am, vin  wrote:
>
> > > Hi Guys,
>
> > > Debugging further shows that with "sleep" the response time and bytes
> > > recieved are proper but when "sleep" is removed the time and recieved
> > > bytes are "zero". Also, without "sleep" navigation to multiple pages
> > > is very fast (script will not wait until page is laoded).
>
> > > Script with sleep:
> > > -
> > > plugin.Clear()
> > > plugin.Log.EnableFilter(false)
> > > plugin.Record()
> > > ie.div(:id, "configure_access_left").fireEvent("onmouseup")   <<<1st
> > > page
> > > sleep 10          <<<
> > > ie.div(:id, "configure_nat_left").fireEvent("onmouseup")  <<<2nd page
> > > sleep 10          <<<
> > > plugin.Stop()
> > > if plugin.Log.Pages.Count != 0
> > >         page1= plugin.Log.Pages(0).Entries.Summary
> > >         printf "Total time to load page (secs):      %.3f\n", page1.Time
> > >         printf "Number of bytes received on network: %d\n",
> > > page1.BytesReceived
>
> > > end
>
> > > ## output with sleep
>
> > > Total time to load page (secs):      5.199
> > > Number of bytes received on network: 427
>
> > > ##Script without Sleep
> > > 
>
> > > ie.div(:id, "configure_access_left").fireEvent("onmouseup")   <<<1st
> > > page
> > > ie.div(:id, "configure_nat_left").fireEvent("onmouseup")  <<<2nd page
> > > plugin.Stop()
> > > 
> > > #ouptput:
> > > -
> > > Total time to load page (secs):      0.002
> > > Number of bytes received on network: 0
>
> > > Kindly let me know the cause for this behaviour and also better
> > > solution to use for page to laod before navigation to next page.
>
> > > On Mar 17, 1:06 am, vin  wrote:
>
> > > > Hi,
>
> > > > I am using fireevent to click a div (button to navigate to a page) as
> > > > shown:
> > > > (ie.div(:id, "configure_access_left").fireEvent("onmouseu

[wtr-general] Re: Click on links on a dynamic pane

2011-03-21 Thread Chuck van der Linden
Credit goes to Bret and Brian for choosing Ruby as the language when
they first set about to create watir..

However the .parent method is purely a Watir thing, I don't know who
came up with the idea of doing that, but it's a GREAT addition to
Watir.

and just call me Chuck

('van der Linden' is rather a lot to type, and most of us go by our
first-names anyway, not our family names)

On Mar 18, 3:35 am, Aravind  wrote:
> Woow Linden
>
> Its working fine. Surprised to see that.
> Thank you very much for your help.
> Till now i heard about ruby and now i am realising how easy it is.
>
> below is the code I used.
>
>     for i in 3..table.row_count - 1
>       if table[i][8].text == "APV"
>         table[i][1].link(:index,1).click
>         table[i][1].link(:index,1).parent.link(:text,"Open This
> Version").click
>         i = table.row_count
>       end
>    end
>
> thanks
> aravind
>
> On Thu, Mar 17, 2011 at 11:00 PM, Chuck van der Linden 
> wrote:
>
> > Can you show me the code for the click?
>
> > from the looks of the dom, the original link you click to see the sub-
> > menu, and those menu items, are all 'inside' that table row.   I
> > suspect that the challeng is that there are other similar hidden links
> > (at that point) on each of the other table rows, all with the same
> > link text etc..   Making clicking the right one a challenge;
>
> > So you might be able to identify them according to a sibling
> > relationship with the link you clicked
>
> >  Try using the same code as for the click, but replace the .click with
> > the following
>
> >  .parent.link(:text, "Open This Version").click
>
> > as Basim indicated, you may have to FIRST fire an onmouseover event
> > against that element, since I see code in there that is reacting to
> > that event, and perhaps if it does not see that first, you won't be
> > able to click it
>
> > On Mar 17, 8:25 am, Aravind  wrote:
> > > Basim
>
> > > I used Click method
>
> > > thanks
> > > aravind
>
> > > On Thu, Mar 17, 2011 at 8:51 PM, Basim Baassiri 
> > wrote:
> > > > When you say click on the action, do you use click method or do you use
> > > > fire_event ?
>
> > > >   On Thu, Mar 17, 2011 at 11:13 AM, Aravind  > >wrote:
>
> > > >>   Hi
>
> > > >> This is the continuation of my previous question which is resolved.
>
> > > >> I have some links with the name "action" in the1st column of all the
> > > >> rows in a table.
> > > >> When I click the action link a dynamic pane will be displayed with few
> > > >> more links.
> > > >> Now i have click on any of the links on the pane.
>
> > > >> The image of the page and the html is attached.
>
> > > >> Please help.
>
> > > >> thanks
> > > >> aravind
>
> > > >> --
> > > >> 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 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] Error on Watir installation

2011-03-21 Thread blkjk
on WIN7 with:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

gem install watir yields error:  hoe requires RubyGems version 1.4

tried 'gem update --system', but no improvement

I have installed successfully on other pcs w/ same, but failing here.
Thoughts?

-- 
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] Error on Watir installation

2011-03-21 Thread Tim Koopmans
For the time being, install rubygems manually, I've been having similar
trouble with firewatir and ubuntu

http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.zip
unzip rubygems-1.6.2.zip
ruby rubygems-1.6.2/setup.rb

Cheers,
Tim

@90kts



On Tue, Mar 22, 2011 at 10:04 AM, blkjk  wrote:

> on WIN7 with:
> - RUBYGEMS VERSION: 1.3.7
> - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> gem install watir yields error:  hoe requires RubyGems version 1.4
>
> tried 'gem update --system', but no improvement
>
> I have installed successfully on other pcs w/ same, but failing here.
> Thoughts?
>
> --
> 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: Error on Watir installation

2011-03-21 Thread blkjk
That did not work either. :(

On Mar 21, 4:11 pm, Tim Koopmans  wrote:
> For the time being, install rubygems manually, I've been having similar
> trouble with firewatir and ubuntu
>
> http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.zip
> unzip rubygems-1.6.2.zip
> ruby rubygems-1.6.2/setup.rb
>
> Cheers,
> Tim
>
> @90kts
>
>
>
>
>
>
>
> On Tue, Mar 22, 2011 at 10:04 AM, blkjk  wrote:
> > on WIN7 with:
> > - RUBYGEMS VERSION: 1.3.7
> > - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> > gem install watir yields error:  hoe requires RubyGems version 1.4
>
> > tried 'gem update --system', but no improvement
>
> > I have installed successfully on other pcs w/ same, but failing here.
> > Thoughts?
>
> > --
> > 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


Re: [wtr-general] Re: Error on Watir installation

2011-03-21 Thread Tim Koopmans
I'd definitely recommend Ruby 1.8.7 over 1.8.6. It comes with a newer
version of rubygems
Check instructions at http://watir.com/installation for location of binary

Cheers,
Tim

@90kts



On Tue, Mar 22, 2011 at 11:05 AM, blkjk  wrote:

> That did not work either. :(
>
> On Mar 21, 4:11 pm, Tim Koopmans  wrote:
> > For the time being, install rubygems manually, I've been having similar
> > trouble with firewatir and ubuntu
> >
> > http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.zip
> > unzip rubygems-1.6.2.zip
> > ruby rubygems-1.6.2/setup.rb
> >
> > Cheers,
> > Tim
> >
> > @90kts
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Mar 22, 2011 at 10:04 AM, blkjk  wrote:
> > > on WIN7 with:
> > > - RUBYGEMS VERSION: 1.3.7
> > > - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> >
> > > gem install watir yields error:  hoe requires RubyGems version 1.4
> >
> > > tried 'gem update --system', but no improvement
> >
> > > I have installed successfully on other pcs w/ same, but failing here.
> > > Thoughts?
> >
> > > --
> > > 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
>

-- 
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: Error on Watir installation

2011-03-21 Thread blkjk
I had to also add System variable to environment path: RUBYOPT  -
rubygems
Thk you.

On Mar 21, 5:30 pm, Tim Koopmans  wrote:
> I'd definitely recommend Ruby 1.8.7 over 1.8.6. It comes with a newer
> version of rubygems
> Check instructions athttp://watir.com/installationfor location of binary
>
> Cheers,
> Tim
>
> @90kts
>
>
>
>
>
>
>
> On Tue, Mar 22, 2011 at 11:05 AM, blkjk  wrote:
> > That did not work either. :(
>
> > On Mar 21, 4:11 pm, Tim Koopmans  wrote:
> > > For the time being, install rubygems manually, I've been having similar
> > > trouble with firewatir and ubuntu
>
> > >http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.zip
> > > unzip rubygems-1.6.2.zip
> > > ruby rubygems-1.6.2/setup.rb
>
> > > Cheers,
> > > Tim
>
> > > @90kts
>
> > > On Tue, Mar 22, 2011 at 10:04 AM, blkjk  wrote:
> > > > on WIN7 with:
> > > > - RUBYGEMS VERSION: 1.3.7
> > > > - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> > > > gem install watir yields error:  hoe requires RubyGems version 1.4
>
> > > > tried 'gem update --system', but no improvement
>
> > > > I have installed successfully on other pcs w/ same, but failing here.
> > > > Thoughts?
>
> > > > --
> > > > 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