[Wtr-general] keyword framework

2007-03-22 Thread aidy lewis
Hi,

Has anyone written a simple keyword framework with Watir and would
like to share a sample of it? If I remember Phlip may have done
something like this.

aidy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Unable to select the button from button-menu

2007-03-22 Thread Mathew Jacob
Hi,

 

I am unable to select the button from the button-menu. Following is the
scenario. Please help me to resolve this issue.

 

 

Scenario:

In Yahoo Mail, Inbox folder(Click on Inbox), there exists a buttonmenu
dropdown “Mark”. It has two options “Mark as Read” and “Mark as
Unread”.

Problem#

 Unable to click the options “Mark as Read” or Mark as Unread”

Tried and Failed:

ie.select_list(:name,”top_read_unread”).select(“Mark as Read”)

Error:

irb(main):007:0> ie.button(:name,"top_bpress_topmark").click

=> ""

irb(main):008:0> ie.select_list(:name,"top_read_unread").select("Mark as
Unread")

Watir::Exception::UnknownObjectException: Unable to locate object, using
name and top_read_unread

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists'

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2940:in
`select_item_in_select_list'

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2925:in `select'

from (irb):8

from ♥:0

irb(main):009:0> ie.select_list(:name,"top_read_unread").exists?

=> false

irb(main):010:0> ie.div(:id,"markmenu").exists?

=> true

irb(main):011:0>

 

The Html code:





Mark as Unread

Mark as Read





Move...Inbo xPersonal
Sen t
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] clicking image (button?)

2007-03-22 Thread Parv
Hi,
Please Help, as i'm trying to click on on image (button) that fires an 
onClick() event.

Here's html: 


I have tried the following, but none has worked so far:
* $ie.image(:src, 'http://myDomain.com/images/prep/new/submit.jpg').flash()
* $ie.image(:src, /submit/).flash()
* $ie.button(:src => /submit./, :index => 2).click()

Your help is highly appreciated. Thanks!!!

Parv
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] watir faqs

2007-03-22 Thread Lillis, Dara
That's not my understanding. I thought http://www.openqa.org/watir/ was
now the main site for everything Watir-y.

I see two things that have not been migrated from
http://wtr.rubyforge.org/: the tutorial, and the sample test. If those
were moved, it would make sense to me that the old sites be deprecated
and the URL http://wtr.rubyforge.org/ forwarded to
http://www.openqa.org/watir/

Am I wrong?

-D

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, March 21, 2007 5:29 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] watir faqs





Hello,

My understanding is that Rubyforge site is not deprecated.  The site
wtr.rubyforge.org is the main release site for WATIR, which is the
current home to WATIR 1.4  When WATIR 1.5 goes "live" the release code
and supporting documentation will be placed here.

The openqa site is intended to be the development site.  This site
allows teams to use the latest WATIR methods, documentation, submit
defects, vote on features etc...; however, I believe at this point this
is not considered a stable release candidate.

I hope this helps.  If I am wrong I am sure Charlie and Bret will
quickly correct these statements.  :0)

Carl




 

 "aidy lewis"

 <[EMAIL PROTECTED]

 email.com>
To 
 Sent by:  wtr-general@rubyforge.org

 wtr-general-bounc
cc 
 [EMAIL PROTECTED]

 
Subject 
   Re: [Wtr-general] watir faqs

 03/21/2007 04:18

 PM

 

 

 Please respond to

 [EMAIL PROTECTED]

 orge.org

 

 





> http://wiki.openqa.org/display/WTR/FAQ ?

Is this a deprecated site then

http://wtr.rubyforge.org/  ?

with a faq url of:

http://wtr.rubyforge.org/wiki/wiki.pl?

cheers

aidy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Oscar
Thanks a lot! that is helpful but I was hoping not to have to do a lot of 
hacking around to get it to work. I'm surprised there isn't a more streamlined 
or integrated solution, given the ubiquity of this type of login. 

For my case I guess I can use the browser's autologin feature but if the test 
I'm working on goes "live" i'll need to find another solution to fix this. 
Something I've used before was "sendkeys" but I'm not sure if I could apply its 
functionality to this problem.

thanks again, I'll post back later with my results.

O.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] watir faqs

2007-03-22 Thread Charley Baker

The openqa site is the main site right now. We're keeping the RubyForge site
up as well since that's often the first site that people hit when searching
for Watir, and connects us to the ruby community to some extent. Otherwise,
as you can see, openqa is more current and where most of the information for
the project is stored.

-Charley

On 3/22/07, Lillis, Dara <[EMAIL PROTECTED]> wrote:


That's not my understanding. I thought http://www.openqa.org/watir/ was
now the main site for everything Watir-y.

I see two things that have not been migrated from
http://wtr.rubyforge.org/: the tutorial, and the sample test. If those
were moved, it would make sense to me that the old sites be deprecated
and the URL http://wtr.rubyforge.org/ forwarded to
http://www.openqa.org/watir/

Am I wrong?

-D

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, March 21, 2007 5:29 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] watir faqs





Hello,

My understanding is that Rubyforge site is not deprecated.  The site
wtr.rubyforge.org is the main release site for WATIR, which is the
current home to WATIR 1.4  When WATIR 1.5 goes "live" the release code
and supporting documentation will be placed here.

The openqa site is intended to be the development site.  This site
allows teams to use the latest WATIR methods, documentation, submit
defects, vote on features etc...; however, I believe at this point this
is not considered a stable release candidate.

I hope this helps.  If I am wrong I am sure Charlie and Bret will
quickly correct these statements.  :0)

Carl






 "aidy lewis"

 <[EMAIL PROTECTED]

 email.com>
To
 Sent by:  wtr-general@rubyforge.org

 wtr-general-bounc
cc
 [EMAIL PROTECTED]


Subject
   Re: [Wtr-general] watir faqs

 03/21/2007 04:18

 PM





 Please respond to

 [EMAIL PROTECTED]

 orge.org









> http://wiki.openqa.org/display/WTR/FAQ ?

Is this a deprecated site then

http://wtr.rubyforge.org/  ?

with a faq url of:

http://wtr.rubyforge.org/wiki/wiki.pl?

cheers

aidy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] watir faqs

2007-03-22 Thread Lillis, Dara
if you're going to keep http://wtr.rubyforge.org/ site up, I'd suggest
including a link to the openqa site somewhere prominent.
 
for new users who end up at wtr.rubyforge.org, there is currently no
indication that the openqa site exists, and the faq and wiki links are
dead.
 
my suggestion would be to keep a bare-bones site at
http://wtr.rubyforge.org/   which would
auto-forward to http://www.openqa.org/watir/
 
I'd be happy to help with this if you want to do it.
 
-D



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Charley Baker
Sent: Thursday, March 22, 2007 12:02 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] watir faqs


The openqa site is the main site right now. We're keeping the RubyForge
site up as well since that's often the first site that people hit when
searching for Watir, and connects us to the ruby community to some
extent. Otherwise, as you can see, openqa is more current and where most
of the information for the project is stored. 

-Charley


On 3/22/07, Lillis, Dara <[EMAIL PROTECTED]> wrote: 

That's not my understanding. I thought
http://www.openqa.org/watir/ was
now the main site for everything Watir-y.

I see two things that have not been migrated from
http://wtr.rubyforge.org/: the tutorial, and the sample test. If
those
were moved, it would make sense to me that the old sites be
deprecated
and the URL http://wtr.rubyforge.org/ forwarded to
http://www.openqa.org/watir/

Am I wrong?

-D

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED] 
Sent: Wednesday, March 21, 2007 5:29 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] watir faqs





Hello,

My understanding is that Rubyforge site is not deprecated.  The
site 
wtr.rubyforge.org is the main release site for WATIR, which is
the
current home to WATIR 1.4  When WATIR 1.5 goes "live" the
release code
and supporting documentation will be placed here. 

The openqa site is intended to be the development site.  This
site
allows teams to use the latest WATIR methods, documentation,
submit
defects, vote on features etc...; however, I believe at this
point this
is not considered a stable release candidate.

I hope this helps.  If I am wrong I am sure Charlie and Bret
will
quickly correct these statements.  :0)

Carl






 "aidy lewis" 

 <[EMAIL PROTECTED]

 email.com>
To
 Sent by:  wtr-general@rubyforge.org


 wtr-general-bounc
cc
 [EMAIL PROTECTED]


Subject
   Re: [Wtr-general] watir
faqs

 03/21/2007 04:18 

 PM





 Please respond to

 [EMAIL PROTECTED]

 orge.org









> http://wiki.openqa.org/display/WTR/FAQ ?

Is this a deprecated site then

http://wtr.rubyforge.org/  ?

with a faq url of: 

http://wtr.rubyforge.org/wiki/wiki.pl?

cheers

aidy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list 
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___ 
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general 



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Charley Baker

We use AutoIt to bypass proxy authentication dialogs, very similar to your
Apache basic authentication dialog. Take a look at WindowHelper.rb in the
installed watir files, there's a method called logon which should work for
you, or at least give you a general idea. Additionally, there's
documentation on AutoIt here:
http://www.autoitscript.com/autoit3/docs/functions.htm

The areas that might help if you need to roll your own are: WinActivate to
make sure your window is active, ControlSetText to populate
username/password and ControlClick to click the OK button.

You can also try WinClicker, but Ethan's right, seems to work better for
some than others.

-Charley

On 3/22/07, Oscar <[EMAIL PROTECTED]> wrote:


Thanks a lot! that is helpful but I was hoping not to have to do a lot of
hacking around to get it to work. I'm surprised there isn't a more
streamlined or integrated solution, given the ubiquity of this type of
login.

For my case I guess I can use the browser's autologin feature but if the
test I'm working on goes "live" i'll need to find another solution to fix
this. Something I've used before was "sendkeys" but I'm not sure if I could
apply its functionality to this problem.

thanks again, I'll post back later with my results.

O.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] clicking image (button?)

2007-03-22 Thread Charley Baker

Hi Parv,

 You should be able to click on it with something like this:

$ie.button(:src, /\/images/prep/new/submit.jpg/).click


* $ie.image(:src, 'http://myDomain.com/images


/prep/new/submit.jpg').flash()



This control is a button in Watir not an image, the full url isn't listed in
the src attribute of the image, so it needs to refer to whatever is there in
the html.

* $ie.image(:src, /submit/).flash()


It's a button, this might work depending on what else is in your html if you
use $ie.button()

* $ie.button(:src => /submit./, :index => 2).click()


Aha, you've now caught the fact that input elements in the latest version of
Watir don't support multiple attributes. If you'd like you can vote for this
issue in Jira as there is a ticket: http://jira.openqa.org/browse/WTR-74

Hope that helps,

Charley



On 3/22/07, Parv <[EMAIL PROTECTED]> wrote:


Hi,
Please Help, as i'm trying to click on on image (button) that fires an
onClick() event.

Here's html:


I have tried the following, but none has worked so far:
* $ie.image(:src, 'http://myDomain.com/images/prep/new/submit.jpg').flash(
)
* $ie.image(:src, /submit/).flash()
* $ie.button(:src => /submit./, :index => 2).click()

Your help is highly appreciated. Thanks!!!

Parv
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Oscar
Thanks, I'm looking into it now. 

Another thing I thought of with the help of someone at my work was to send the 
http headers along with my request for the url. I fired up Ethereal to capture 
the packets and found out some information about the http get I'm doing when 
the username and password get sent.

So if I can find a way to integrate this request into my initial ie open $url 
then I think I can get past this with minimal hassles. But I haven't found a 
way to send a custom http header with the url request. 

O.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] IE.new_process question

2007-03-22 Thread Bach Le
I know that IE.new_process uses the CreateProcess method in kernel32.dll to 
create a new IE process. This same method allows the user to change the 
environment variables for this specific instance of IE (by setting parameter 7 
in the call to CreateProcess).


Does anyone know which environment variables are required when IE starts up and 
how I can set up the environment block to pass to CreateProcess? Thanks


-Bach
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Charley Baker

Well, if you want to go down that roadyou could investigate using
Navigate2 on the internal ie ole_object.

ie = IE.new
ie.ie.Navigate2('http://www.google.com',0,'','')

Navigate2 takes 4 possible parameters: url, a constant flag for options,
postdata, and headers.

The postdata and headers are just strings of standard http headers and
whatever form data you want to send.

There's information on the Navigate2 command on msdn:
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/navigate2.asp

Basic authentication through apache can be sent through the headers if I
remember correctly.

-Charley


On 3/22/07, Oscar <[EMAIL PROTECTED]> wrote:


Thanks, I'm looking into it now.

Another thing I thought of with the help of someone at my work was to send
the http headers along with my request for the url. I fired up Ethereal to
capture the packets and found out some information about the http get I'm
doing when the username and password get sent.

So if I can find a way to integrate this request into my initial ie open
$url then I think I can get past this with minimal hassles. But I haven't
found a way to send a custom http header with the url request.

O.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Chris McMahon
On 3/22/07, Oscar <[EMAIL PROTECTED]> wrote:
> Thanks, I'm looking into it now.
>
> Another thing I thought of with the help of someone at my work was to send 
> the http headers along with my request for the url. I fired up Ethereal to 
> capture the packets and found out some information about the http get I'm 
> doing when the username and password get sent.
>
> So if I can find a way to integrate this request into my initial ie open $url 
> then I think I can get past this with minimal hassles. But I haven't found a 
> way to send a custom http header with the url request.

I actually did this, but IE didn't behave properly.  On a normal
connection with Basic Auth, the browser will allow access to every
link and frame accessible once you've logged in one time.  However, if
you pass Basic Auth headers on the Watir goto() method, the browser
only allows you access to a single page, and the links and frames on
the page are still not accessible.

It's probably possible to hack Watir to pass Basic Auth credentials
for access to every element, but it would be a big job.

-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to access browser authentication pop-up

2007-03-22 Thread Chris McMahon
On 3/22/07, Charley Baker <[EMAIL PROTECTED]> wrote:
> Well, if you want to go down that roadyou could investigate using
> Navigate2 on the internal ie ole_object.
>
> ie = IE.new
> ie.ie.Navigate2('http://www.google.com',0,'','' )

Aha.  I might get around to trying this today, if I can find a site
that has Basic Authentication.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] IE.new_process question

2007-03-22 Thread Bach Le
Nevermind. When creating IE through the CreateProcess method, IE will need to 
read the SystemRoot environment variable.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Control windows dialog box

2007-03-22 Thread sathees
h = $ie2.enabled_popup()
if (h)
  puts 'handle exists!'
   w = WinClicker.new
   w.clickWindowsButton_hwnd(h, "Cancel")
  puts 'pop up canceled'
 end
I found out that this would cancel the save image modal dialog which hangs 
during the image save process. But there is another problem, that is if the 
Image link is broken, then Save HTML Document dialog appeas. How to handle 
this? i tried with AutoItX3.control as follows

autoit = WIN32OLE.new(AutoItX3.Control)
ret = autoit.WinWait('Save HTML Document', '', 1)
if (ret==1)
autoit.Send('{Save}')
end
but I am getting an Name error AutoItX3. Do anyone know why?

Appreciate any help!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Save Image Hangs?

2007-03-22 Thread sathees
see "Control Windows Dialog Box" thread
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Control windows dialog box

2007-03-22 Thread sathees
Using Ruby 1.8.6 & Watir 1.5.1.1127
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Unable to select the button from button-menu

2007-03-22 Thread Angrez Singh

Hi Mathew,

Just looked at the Yahoo mail app (not the beta one) and had a look at the
HTML. The options that you are trying to select like "Mark as Read", "Mark
as Unread" are in  tags. So you need to access them using xpath and then
fire click event. Following code works for me for marking first message in
inbox are read.
require 'watir'

include Watir

ie = IE.new
ie.goto("http://mail.yahoo.com";)
ie.maximize()
ie.text_field(:name, "login").set(username)
ie.text_field(:name, "passwd").set(password)
ie.button(:value, "Sign In").click()
ie.button(:id, "checkmailbutton").click()
# select first message.
ie.radio(:id, "folderviewmsg0checkbox").set()
# click on mark button so as options can be displayed
ie.button(:value, "Mark").click()
# select  element that has text "Mark as Read"
element = ie.element_by_xpath("//li[contains(.,'Mark as Read')]")
# Print properties of the element just to make sure you selected correct
element.
puts element.value
puts element.tagName
puts element.innerHTML
# fire click event.
element.click()

Let me know if this works.

Regards,
Angrez


On 3/22/07, Mathew Jacob <[EMAIL PROTECTED]> wrote:


 Hi,



I am unable to select the button from the button-menu. Following is
the scenario. Please help me to resolve this issue.





*Scenario:*

In Yahoo Mail, Inbox folder(Click on Inbox), there exists a buttonmenu
dropdown "Mark". It has two options "Mark as Read" and "Mark as Unread".

*Problem#*

* *Unable to click the options "Mark as Read" or Mark as Unread"

*Tried and Failed:*

ie.select_list(:name,"top_read_unread").select("Mark as Read")

*Error*:

irb(main):007:0> ie.button(:name,"top_bpress_topmark").click

=> ""

irb(main):008:0> ie.select_list(:name,"top_read_unread").select("Mark as
Unread")

Watir::Exception::UnknownObjectException: Unable to locate object, using
name and top_read_unread

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in
`assert_exists'

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2940:in
`select_item_in_select_list'

from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2925:in `select'

from (irb):8

from ♥:0

irb(main):009:0> ie.select_list(:name,"top_read_unread").exists?

=> false

irb(main):010:0> ie.div(:id,"markmenu").exists?

=> true

irb(main):011:0>



*The Html code*:





Mark as Unread

Mark as Read





Move...Inbo xPersonal
Sen thttp://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general