[wtr-general] Re: watir webdriver and javascript drop down menu in IE

2012-04-19 Thread mndude
The "hover" method produces the same result as "click" on the top
menu.

On Apr 19, 5:01 pm, Chuck van der Linden  wrote:
> if you are using watir-webdriver have you tried the 'hover' method to get
> the dropdown to appear?
>
>
>
>
>
>
>
> On Thursday, April 19, 2012 2:52:27 PM UTC-7, mndude wrote:
>
> > I have a web app with a top menu bar with drop down menus in it driven
> > by javascript (extjs).  I can easily access the menu items in Firefox
> > and Chrome.  But IE does not work the same way.  The menu requires
> > either a mouse hover or click on the top item to drop down and then a
> > click on the item to be selected.  This is easy and fast in FF,
> > Chrome:
>
> > driver.p( :text => topmenu ).when_present.click
> > driver.a( :text => submenu ).when_present.click
>
> > In IE what happens is that the first click drops down the menu, but
> > then the menu disappears before the 2nd line can complete the click on
> > the actual item to be selected.  The 2nd click fails because the item
> > is, of course, not visible.
>
> > Watir webdriver appears to not have the Selenium webdriver actions?
> > In Selenium webdriver I would try something like this:
>
> > driver.action.click(topmenu).click(submenu).perform
>
> > Is there a way to access the Selenium webdriver actions in Watir
> > webdriver?  Or some other solution for IE in this situation?  The
> > Watir browser object appears to not have an "action" set of methods.

-- 
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 and javascript drop down menu in IE

2012-04-19 Thread Chuck van der Linden
if you are using watir-webdriver have you tried the 'hover' method to get 
the dropdown to appear?

On Thursday, April 19, 2012 2:52:27 PM UTC-7, mndude wrote:
>
> I have a web app with a top menu bar with drop down menus in it driven 
> by javascript (extjs).  I can easily access the menu items in Firefox 
> and Chrome.  But IE does not work the same way.  The menu requires 
> either a mouse hover or click on the top item to drop down and then a 
> click on the item to be selected.  This is easy and fast in FF, 
> Chrome: 
>
> driver.p( :text => topmenu ).when_present.click 
> driver.a( :text => submenu ).when_present.click 
>
> In IE what happens is that the first click drops down the menu, but 
> then the menu disappears before the 2nd line can complete the click on 
> the actual item to be selected.  The 2nd click fails because the item 
> is, of course, not visible. 
>
> Watir webdriver appears to not have the Selenium webdriver actions? 
> In Selenium webdriver I would try something like this: 
>
> driver.action.click(topmenu).click(submenu).perform 
>
> Is there a way to access the Selenium webdriver actions in Watir 
> webdriver?  Or some other solution for IE in this situation?  The 
> Watir browser object appears to not have an "action" set of methods.

-- 
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: Newbie w/ Few Questions

2012-04-19 Thread Chuck van der Linden
below

On Thursday, April 19, 2012 1:48:13 PM UTC-7, Michael Goldberg wrote:
>
> Hi, 
>
> I am new to Watir. 
> I have been using AutoIT for a lot of my automation, and find that in 
> some instances I am unable to do what I need due to the complicated 
> scripting of webpages. I looked into other languages and thought Watir 
> would be a nice fit for what I need. 
>
> I have a few questions, I was hoping someone might be able to answer. 
>
> 1) Syntax, 
> Looking at different examples on the web I see the sometimes 
> ie.frame(:index, 1) is used and other times ie.frame(:index => 1) is 
> used, what is the difference?  Sometimes one works for me other times 
> they don't. 
>
The content of the parenthesis is basically one or more pairs of 
label&value that tells watir how to identify the element.  The way Ruby 
works , you can do any of the following (where 'how' is something like id, 
name, etc, and 'what' is a value)

 browser.element(:how, 'what')
 browser.element(:how => 'what) 
 browser.element(:how1 => 'what1', :how2 => 'what2')  (or more pairs if 
needed)

We used to show just the first instance in most of our docs, but this got 
confusing for people when then later showing how to use multiple criteria 
(the third example), so we switch to the => style since it is more 
consistent, and it's easier to explain just add a comma and another set of 
:how => 'what', if you need more than one criteria to create a unique way 
to identify and object.  Most of the time you see the comma version, or 
'ie' instead of 'browser' you are looking at an older piece of documentation
 

>
> 2)Output, 
> How do I see what I am doing? 
> With Autoit, I was able to see what i was doing via the console? 
> I would find the object, and print out the innerhtml to make sure I 
> was in the correct spot? Is there something similar in Watir?  Is 
> there a command to see the text and / or html of an object? 
>

Lots of ways to do this.  Firstly learn a bit about IRB which allows you to 
enter a command at a time and see things happen.   

For seeing if I have the right object, I use the .flash method a lot, but 
you can also examine properties such as .text or .html   If you look at the 
rdoc you can see what objects support what methods, but pretty much if it 
makes sense it's likely to work. (in other words don't expect an image 
element to have .text, but do expect it to have .height and .width) when in 
doubt, refer to the rdoc 
(http://rubydoc.info/github/watir/watir-webdriver/master/frames)
 

>
> 3)I am having issues connecting to frames. 
> I connect to IE fine, and then run ie.show_frames 
> It prints out a list of frames on the screen. 
> I try the syntax ie.frame(:index, 1) and i get an error message 
> stating located=false 
> If I try ie.frame(:index, 1).locate, it seems that I get connected. 
> But then when I try going deeper into another nested frame I keep 
> getting error messages. 
>
> I visited the wiki page http://wiki.openqa.org/display/WTR/Frames 
> and when I try their example 
>
> ie.frame(:name, "frame").frame(:name, "nested_frame") 
>
> this doesn't work I'm assuming because 
> this doesn't work - ie.frame(:name, "frame") 
>
> I would appreciate any help available 
>

Likely there the problem is that you are looking at an older doc that needs 
to be updated to account for the change from one based to zero based 
indexing.  To be more compatible with how ruby works, how webdriver works 
etc we've moved watir from index values that start with 1 being the first 
instance, to 0 being the first instance.

Only use index values if there is not some other better way such as an ID, 
or Name to identify the frame.   If you can show us the HTML for the frame, 
I (or someone else) could give you a more specific example  


> Thanks, Mike


You didn't ask, but I recommend you move to using watir-webdriver.  That 
gives your cross browser support (where watir only supports IE) and will 
run on operating systems other than windows.  It's the future direction the 
watir project is moving in.  

-- 
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 and javascript drop down menu in IE

2012-04-19 Thread mndude
I have a web app with a top menu bar with drop down menus in it driven
by javascript (extjs).  I can easily access the menu items in Firefox
and Chrome.  But IE does not work the same way.  The menu requires
either a mouse hover or click on the top item to drop down and then a
click on the item to be selected.  This is easy and fast in FF,
Chrome:

driver.p( :text => topmenu ).when_present.click
driver.a( :text => submenu ).when_present.click

In IE what happens is that the first click drops down the menu, but
then the menu disappears before the 2nd line can complete the click on
the actual item to be selected.  The 2nd click fails because the item
is, of course, not visible.

Watir webdriver appears to not have the Selenium webdriver actions?
In Selenium webdriver I would try something like this:

driver.action.click(topmenu).click(submenu).perform

Is there a way to access the Selenium webdriver actions in Watir
webdriver?  Or some other solution for IE in this situation?  The
Watir browser object appears to not have an "action" set of methods.

-- 
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: pdf file downloading from browser

2012-04-19 Thread Chuck van der Linden
read this  http://wiki.openqa.org/display/WTR/File+Downloads

follow directions.

if you cannot turn off the prompts for where to download, then you will 
need to use something like RAutomation or AutoIT to automate the responses 
to the (OS Level, not part of a web page) download dialogs

On Thursday, April 19, 2012 4:02:58 AM UTC-7, sipin raj vr wrote:
>
> I am trying to automate a screen which is having a link to open a pdf 
> file and also i want to save this file to my system.. 
> Can anyone tell me how i can do it?

-- 
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] Newbie w/ Few Questions

2012-04-19 Thread Michael Goldberg
Hi,

I am new to Watir.
I have been using AutoIT for a lot of my automation, and find that in
some instances I am unable to do what I need due to the complicated
scripting of webpages. I looked into other languages and thought Watir
would be a nice fit for what I need.

I have a few questions, I was hoping someone might be able to answer.

1) Syntax,
Looking at different examples on the web I see the sometimes
ie.frame(:index, 1) is used and other times ie.frame(:index => 1) is
used, what is the difference?  Sometimes one works for me other times
they don't.

2)Output,
How do I see what I am doing?
With Autoit, I was able to see what i was doing via the console?
I would find the object, and print out the innerhtml to make sure I
was in the correct spot? Is there something similar in Watir?  Is
there a command to see the text and / or html of an object?

3)I am having issues connecting to frames.
I connect to IE fine, and then run ie.show_frames
It prints out a list of frames on the screen.
I try the syntax ie.frame(:index, 1) and i get an error message
stating located=false
If I try ie.frame(:index, 1).locate, it seems that I get connected.
But then when I try going deeper into another nested frame I keep
getting error messages.

I visited the wiki page http://wiki.openqa.org/display/WTR/Frames
and when I try their example

ie.frame(:name, "frame").frame(:name, "nested_frame")

this doesn't work I'm assuming because
this doesn't work - ie.frame(:name, "frame")

I would appreciate any help available

Thanks, Mike

-- 
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] pdf file downloading from browser

2012-04-19 Thread Željko Filipin
On Thu, Apr 19, 2012 at 1:02 PM, sipin raj vr  wrote:
> I am trying to automate a screen which is having a link to open a pdf
> file and also i want to save this file to my system..

And what is the problem?

Željko
--
watir.com/book - author

-- 
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] pdf file downloading from browser

2012-04-19 Thread sipin raj vr
I am trying to automate a screen which is having a link to open a pdf
file and also i want to save this file to my system..
Can anyone tell me how i can do it?

-- 
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