[wtr-general] Re: Automating a File uploader popup

2009-06-17 Thread orde

Hi Natasha (and all)--

This might be OT, but I'll throw it out there because you mentioned
flash a couple of times in this thread.

Is there an  tag associated with the page element that you're
trying to access?  If you right-click on the page element using
Firefox, do you see an overlay about "About Adobe Flash Player"?

If so, my understanding is that out-of-the-box watir doesn't support
flash, so the above solutions won't necessarily work.

Hope that helps...

orde
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Watir like test tool for windows-applications

2009-06-17 Thread Richard Wijdenes

Hi there,

does anybody use Open Source Test Tools for "normal" applications?

With "normal" I mean non-web-applications.
Main Platform: Windows. Cross-platform (Ubuntu-linux/windows) would be
nice.

I would like the ease of use and scripting functionality of Watir and
RUBY.

Grtz.R.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] ICEfaces Support

2009-06-17 Thread WebTestGadfly

Anybody know anything about testing ICEfaces?

The Autocompleter function in particular?

-WTG
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to fetch the Selected Item in a ListBox

2009-06-17 Thread wsm


Thanks everybody for this.

Bill Mosteller
Eloqua
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: 30 Second Pauses When Scripting Hotmail

2009-06-17 Thread wsm

Thanks, figured out how to disable Shockwave Flash on MS-IE and as we
suspected, the 30-second pauses are gone.  Thanks to all.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general?hl=en
-~--~~~~--~~--~--~---



[wtr-general] Re: Can't click on text in a cell which is located in undefined tables

2009-06-17 Thread orde

Something like this might get you going in the right direction:

browser.cell(:text, 'text_to_click').fire_event('ondblclick')

Hope that helps...

orde
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Automating a File uploader popup

2009-06-17 Thread Natasha Ranney
Thanks for the pointer. Unfortunately I tried to automate the click event for 
the span and it didn't popup the upload file window.

I saw that watir identified the button and even clicked it, but nothing 
happened. But when I try to do the same manually it works fine.

Source code for the page under test:



Upload your images to 
MOO



Watir command executed:

#$ie.span(:id,"spnUploadButton").fire_event("OnMouseDown")
  #$ie.span(:id,"spnUploadButton").fire_event("OnMouseUp")
$ie.span(:id,"spnUploadButton").click

NOTE: I tried both click method as well as fire_events. None worked.

Thanks,
Natasha





From: al3kc 
To: Watir General 
Sent: Wednesday, 17 June, 2009 9:17:37
Subject: [wtr-general] Re: Automating a File uploader popup


Watir use AutoIt For file uploading. set method for file_field looks
like

def set(setPath)
  assert_exists
  require 'watir/windowhelper'
  WindowHelper.check_autoit_installed
  begin
thrd = Thread.new do
  system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new
('AutoItX3.Control'); waitresu...@autoit.winwait 'Choose file', '',
15; sleep 1; if waitresult == 1\" -e \"@autoit.ControlSetText 'Choose
file', '', 'Edit1', '#{setPath}'; @autoit.ControlSend 'Choose file',
'', 'Button2', '{ENTER}';\" -e \"end\"")
end
  thrd.join(1)
  rescue
raise Watir::Exception::WatirException, "Problem accessing
Choose file dialog"
  end
  click
end

You can try to invoke this autoit code after clicking the span or
rewrite this method for Span class


  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: 30 Second Pauses When Scripting Hotmail

2009-06-17 Thread Željko Filipin
On Wed, Jun 17, 2009 at 4:58 PM, wsm  wrote:
> Excellent answers!  How do I disable flash?

Firefox > Tools > Add-ons > Plugins > Shockwave Flash > Disable

I guess it is similar in IE.

> Alternate approaches to reading Email would be of interest.

Ruby has smtp library (
http://www.ruby-doc.org/stdlib/libdoc/net/smtp/rdoc/index.html) and there is
Tmail gem (http://tmail.rubyforge.org/) that has some advanced
functionality. I use it to test e-mails that my app sends. There is no need
for web mail.

Željko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: 30 Second Pauses When Scripting Hotmail

2009-06-17 Thread wsm



On Jun 17, 8:58 am, "Mark Anderson" 
wrote:
>
> Why are you scripting against Hotmail?  
> If it is to automate an email task, I would think
> that there would be better solutions for scripting against hotmail than
> using watir to drive a browser.

Excellent answers!  How do I disable flash?

Application under test creates E-mails as part of its capabilities, so
examining them is part of the test.

I knew I didn't wish to script Outlook (too hard), and we have ids for
Gmail, Hotmail, and Yahoo.  As I have existing accounts on Google and
Yahoo, Hotmail looked attractive.

Alternate approaches to reading Email would be of interest.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: using Rails routes

2009-06-17 Thread jason

in principle - there is no reason that is should not work.

except if depends on the mocks and stubs you are using for your
testing.

you need the full (ulr_for) resolution url name for the browser.goto

as you need the mongral server running to generate the page in the
browser, i am not so sure that it makes a lot of sense to mix up the
two test areas.

in the rails environment you are (or should be) testing your program
with mocks and stubs which is entirely independant of an application
server running or not.

if you want to test the "realworld output to the browser" I would do
that outside of rails, afterall it does not really matter what
application generates the pages the you want to test.

hope that is food for thought.

jason


On 17 Jun., 07:59, Macsig  wrote:
> Hello guys,
> I'm new to watir: I have just discovered it through "Cucumber and
> Watir 101" screencast (http://vimeo.com/2871256).
> Right now I'm trying to use it with Cucumber and Rails (as Dave shows
> in the screencast). Here my question:
>
> is it possible to use Rails routes instead absolute URL? Something
> like
>
> Given /^I am on (.+)$/ do |page_name|
>   BROWSER.goto(path_to(page_name))
> end
>
> Unfortunately the code above doesn't work: when I run Cucumber the
> step passes but the browser tries to open 'file:///'
>
> Thanks and have a nice day!
>
> Sig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: firewatir form submit working???

2009-06-17 Thread jason

hmmm,

ok - it seems from looking at the firewatir code that I have been
misunderstanding what "fire_event" in the firewatir code does.

I thought it did exactly that - fire an event to the browser through
jssh - which is in hind sight VERY stupid of me.

fire_event seems to literally call the javascript method defined for
the object in the browser dom that will be called when the browser
recieves and event for that object.

So if a method has been attached to an object (onclick, onsubmit etc)
it will just be called through jssh when the firewatir method
fire_event has been called with a specific evet type - and only for
that specific object.
This will not of course effect any other objects listening for the
event - unless fire_event is called for them too (which firefox does
automatically when it gets an event - i.e. keyboard, mouse etc).

This means that we dont really reproduce globally accross all objects
in the browser dom what could happen when an single local object is
clicked or the keyboard is pressed.

I am seeing a lot of pages where many objects are listing for the same
event and then react accordingly - this behaviour we cannot (i dont
think) reproduce with any degree of success.

What does this mean for the submit() method working on some forms and
not on others?

Basically either - there is someway on a unix machine to simulate real
mouse and keyboard events (any suggestions welcome) - or
find the object in the form or on the page that actually submits the
form (objects that are not within the form can easilly be programmed
in javascript to submit the form - even though they have seemingly
nothing to do with the form at all), click it and hope that no other
objects on the page or in the form that do somthing really important
before or after the form get submitted.

I think however, that in most cases a click on the submit object
should work - even though difficult for a software agent to locate
prgramatically.

if anyone has a different view on my findings, please let me know -
and i hope this helps someone else with the same problem.

jason.














On 17 Jun., 10:54, jason  wrote:
> Orde,
>
> Thanks a million for spending so much time on this  - totally
> appreciated.
>
> After consulting my javascript book -
>
> The satement "forms that have onsubmit defined MAY not work when the
> function submit() is called.
>
> It seems that the function submit() does not trigger the onsubmit
> event handler.
> The onsubmit event handler will only be triggered by a genuine click
> (fire event).
>
> onsubmit is evaluated before submit - if false is returned then submit
> will not be excecuted.
>
> The book suggests that onsubmit function can be called seperately with
> element.onsubmit()
>
> So then the following should be the valid sequence.
>
> form(:index, 1).submit if form(:index, 1).onsubmit
>
> (of course an onsubmit method would need to be added to firewatir for
> the above line to work (or the existing js_eval method could eb used
> instead).
>
> HAVING SAID THAT:
>
> The form defined atwww.monster.dedoes not have any buttons and does
> not have onsubmit defined in the form.
>
> so this sort of this thing:
>
> form(:index, 1).submit if form(:index, 1).onsubmit
>
> would not work.
>
> as Orde pointed out, the only thing that works for that form is
> fireing a click event on a specific link.
>
> browser.link(:id, 'ctl00_ctl00_searchBox_MessagizedButton1').click
>
> This link contains the on href "javascript:AjaxSearch_DoSearchRedirect
> ()". It is actually this function that ends up submitting the form.
>
> As there is no direct connection between this link and the form it is
> almost impossible for a mthod to identify this link as actually being
> the element that submits the form.
> This is a disaster if your software has to find forms and submit them
> on its own without knowing about them before hand.
>
> This problem seems to go from the hundreds to the millions very
> quickly - so, is there another solution.
>
> It seems that all the forms in question react to a keyboard return -
> i.e. they submit.
>
> The only thing is - firewatir does not have a way of fireing a
> keyboard event (as far as I know).
> If it did then i could imagine somthing like this working for every
> form:
>
> form(:index, 1).text_field(:index, 1).value="whatever"  #fill in the
> form with something
> form(:index, 1).text_field(:index, 1).click  #this should activate any
> onfocus event handlers on the page
> form(:index, 1).press_enter    #(as apposed to click)
>
> Does anyone know how this could be achieved from within firewatir?
>
> Thanks a million
>
> Jason.
>
> On 17 Jun., 00:07, orde  wrote:
>
> > Took a closer look.
>
> > WORKS:
>
> >http://www.jobware.de/
>
> > ff.form(:index, 1).text_field(:index, 1).value = "ruby"
> > ff.form(:index, 1).submit
>
> > DOESN'T WORK:
>
> >http://www.monster.de
>
> > ff.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> > $_ptbKeywords").value = "12345"
> > ff.form(

[wtr-general] Re: 30 Second Pauses When Scripting Hotmail

2009-06-17 Thread Mark Anderson



> -Original Message-
> From: watir-general@googlegroups.com [mailto:watir-
> gene...@googlegroups.com] On Behalf Of Bill Mosteller
> Sent: Tuesday, June 16, 2009 3:42 PM
> To: Watir General
> Cc: arti.si...@eloqua.com
> Subject: [wtr-general] 30 Second Pauses When Scripting Hotmail
> 
> 
> I'm whipping up a script for Hotmail that signs on, goes to the inbox,
> refreshes it, and opens a message from the inbox.  When the script
> hits the inbox for the first time, or the message, it often pauses for
> about 30 seconds.  I suspect it's waiting for the animated ad on the
> right hand side of the window to finish, but I cannot prove it.
> 
> Thirty seconds is a long time for a script to waste, any ideas how to
> get around this?
> 
> Thanks.
> 
> Bill Mosteller
> Eloqua

I agree with Z* that the first thing to check is that your hypothesis is
correct.  Disable flash, or install a plugin that disables large ads and see
if that fixes your problem - the ad doesn't load and the script moves along
quickly.  As long as you are comfortable with that setup, your problem is
fixed.

If you want the script to ignore the ads, you'll need to look into using
.click_no_wait instead of .click to navigate.  Watir will then not wait for
the page to load, but the downside is that you will need to manually wait
for the elements to load that you are looking for.

Why are you scripting against Hotmail?  People commonly use email sites for
practice/learning, but they are notoriously difficult and therefore not good
practice/learning sites.  If it is to automate an email task, I would think
that there would be better solutions for scripting against hotmail than
using watir to drive a browser.
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4162 (20090617) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to compare Text in Links

2009-06-17 Thread Željko Filipin
Try this (not tested):

puts "uh oh" if $ie.div(:id,"center").link(:index,21).text !=
$ie2.link(:index,31).text

Željko
--
http://watirpodcast.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to compare Text in Links

2009-06-17 Thread Vishal

Thanks,
 In my application link text is dynamically generated .
These the two links whose text value I need to compare
$ie.div(:id,"center").link(:index,21)
$ie2.link(:index,31)



On Jun 15, 6:58 pm, Wesley Chen  wrote:
> Sorry, please try:
> assert $ie.link(:text, ***1).value.eql?($ie.link(:text, ***2).value)
> Thanks.
> Wesley Chen.
>
>
>
> On Mon, Jun 15, 2009 at 9:58 PM, Wesley Chen  wrote:
> > assert $ie.link(:text, ***).value.eql?($ie.link(:text, ***2))- Hide quoted 
> > text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: firewatir form submit working???

2009-06-17 Thread jason

Orde,

Thanks a million for spending so much time on this  - totally
appreciated.

After consulting my javascript book -

The satement "forms that have onsubmit defined MAY not work when the
function submit() is called.

It seems that the function submit() does not trigger the onsubmit
event handler.
The onsubmit event handler will only be triggered by a genuine click
(fire event).

onsubmit is evaluated before submit - if false is returned then submit
will not be excecuted.

The book suggests that onsubmit function can be called seperately with
element.onsubmit()

So then the following should be the valid sequence.

form(:index, 1).submit if form(:index, 1).onsubmit

(of course an onsubmit method would need to be added to firewatir for
the above line to work (or the existing js_eval method could eb used
instead).

HAVING SAID THAT:

The form defined at www.monster.de does not have any buttons and does
not have onsubmit defined in the form.

so this sort of this thing:

form(:index, 1).submit if form(:index, 1).onsubmit

would not work.

as Orde pointed out, the only thing that works for that form is
fireing a click event on a specific link.

browser.link(:id, 'ctl00_ctl00_searchBox_MessagizedButton1').click

This link contains the on href "javascript:AjaxSearch_DoSearchRedirect
()". It is actually this function that ends up submitting the form.

As there is no direct connection between this link and the form it is
almost impossible for a mthod to identify this link as actually being
the element that submits the form.
This is a disaster if your software has to find forms and submit them
on its own without knowing about them before hand.

This problem seems to go from the hundreds to the millions very
quickly - so, is there another solution.

It seems that all the forms in question react to a keyboard return -
i.e. they submit.

The only thing is - firewatir does not have a way of fireing a
keyboard event (as far as I know).
If it did then i could imagine somthing like this working for every
form:

form(:index, 1).text_field(:index, 1).value="whatever"  #fill in the
form with something
form(:index, 1).text_field(:index, 1).click  #this should activate any
onfocus event handlers on the page
form(:index, 1).press_enter#(as apposed to click)

Does anyone know how this could be achieved from within firewatir?

Thanks a million

Jason.
























On 17 Jun., 00:07, orde  wrote:
> Took a closer look.
>
> WORKS:
>
> http://www.jobware.de/
>
> ff.form(:index, 1).text_field(:index, 1).value = "ruby"
> ff.form(:index, 1).submit
>
> DOESN'T WORK:
>
> http://www.monster.de
>
> ff.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> $_ptbKeywords").value = "12345"
> ff.form(:index, 1).submit
>
> BUT THIS WORKS:
>
> browser.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> $_ptbKeywords").value = "12345"
> browser.link(:id, 'ctl00_ctl00_searchBox_MessagizedButton1').click
>
> The above link has an href attribute of
> "javascript:AjaxSearch_DoSearchRedirect()", so there's some redirect
> magic going on there.
>
> COMPARING THE FORM TAGS:
>
> http://www.jobware.de-  action="/st/index.html" name="easyfinder">http://www.monster.de-  id="aspnetForm" class="mainForm"
> action="home.aspx" method="post" name="aspnetForm">
>
> Since action="home.aspx" in form id="aspnetForm", it looks like the
> form data is sent to the home page, which then refreshes.
>
> Hope that helps...
>
> orde
>
> On Jun 16, 4:08 am, jason  wrote:
>
> > Orde,
> > thanks for looking at this.
> > unfortunately thats not the answer - maybe even a little off track.
>
> > I am getting a lot cases where form.submit does not work as expected.
>
> > another case iswww.monster.de
>
> > ff.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> > $_ptbKeywords").value = "12345"
> > ff.form(:index, 1).submit
>
> > The page renders no result from the form.submit (just a page
> > refresh).
>
> > I thought that this might have something to do with the fact that that
> > the form has no submit buttons in it - so tried a from that does have
> > input buttons defined:
>
> >https://careers3.accenture.com/taleo/taleo.asp?countryname=Germany
>
> > ff.frame(:index, 1).form(:index, 1).text_field(:name,
> > "jobNumberSearch").value = "12345"
> > ff.frame(:index, 1).form(:index, 1).submit
>
> > also here, the page renders no result from the form.submit (it just
> > refreshes the page)
>
> > however, this page works just fine:
>
> >http://www.jobware.de/
>
> > ff.form(:index, 1).text_field(:index, 1).value = "ruby"
> > ff.form(:index, 1).submit
>
> > and because i thought it might have somthing to do with iframes being
> > declaired on in the page i built a html document with the google
> > search page in the iframe,
> > that also worked as expected.
>
> > So I really am stuck on why. I cannot figure out what the causing this
> > behaviour - it least if I knew,  could try fixing it.
> > has anyone got any ideas? I am more looking for the cause, 

[wtr-general] Re: 30 Second Pauses When Scripting Hotmail

2009-06-17 Thread Željko Filipin
On Tue, Jun 16, 2009 at 10:42 PM, Bill Mosteller 
wrote:
> I suspect it's waiting for the animated ad on the
> right hand side of the window to finish, but I cannot prove it.

To prove it, disable flash and displaying images (and stuff like that), run
test and see if it still waits 30 seconds.

Željko
--
http://watirpodcast.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Automating a File uploader popup

2009-06-17 Thread al3kc

Watir use AutoIt For file uploading. set method for file_field looks
like

def set(setPath)
  assert_exists
  require 'watir/windowhelper'
  WindowHelper.check_autoit_installed
  begin
thrd = Thread.new do
  system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new
('AutoItX3.Control'); waitresu...@autoit.winwait 'Choose file', '',
15; sleep 1; if waitresult == 1\" -e \"@autoit.ControlSetText 'Choose
file', '', 'Edit1', '#{setPath}'; @autoit.ControlSend 'Choose file',
'', 'Button2', '{ENTER}';\" -e \"end\"")
end
  thrd.join(1)
  rescue
raise Watir::Exception::WatirException, "Problem accessing
Choose file dialog"
  end
  click
end

You can try to invoke this autoit code after clicking the span or
rewrite this method for Span class
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] using Rails routes

2009-06-17 Thread Macsig

Hello guys,
I'm new to watir: I have just discovered it through "Cucumber and
Watir 101" screencast ( http://vimeo.com/2871256 ).
Right now I'm trying to use it with Cucumber and Rails (as Dave shows
in the screencast). Here my question:

is it possible to use Rails routes instead absolute URL? Something
like


Given /^I am on (.+)$/ do |page_name|
  BROWSER.goto(path_to(page_name))
end

Unfortunately the code above doesn't work: when I run Cucumber the
step passes but the browser tries to open 'file:///'


Thanks and have a nice day!



Sig


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: firewatir form submit working???

2009-06-17 Thread jason

Hi Angrez,

No - what I am saying is that under some conditions form.submit does
not work.

I have found that it makes no difference if a form is within a frame
or not.

In general, it seems that some forms work with form.submit and some do
not - I just cannot figure out why.






On 17 Jun., 08:48, Angrez Singh  wrote:
> So jason you mean to say if you are submitting "form" which is inside a
> "Frame/IFrame" it doesn't work. But if that is directly on the page it
> works. Am I correct here?
>
> - Angrez
>
> On Wed, Jun 17, 2009 at 3:37 AM, orde  wrote:
>
> > Took a closer look.
>
> > WORKS:
>
> >http://www.jobware.de/
>
> > ff.form(:index, 1).text_field(:index, 1).value = "ruby"
> > ff.form(:index, 1).submit
>
> > DOESN'T WORK:
>
> >http://www.monster.de
>
> > ff.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> > $_ptbKeywords").value = "12345"
> > ff.form(:index, 1).submit
>
> > BUT THIS WORKS:
>
> > browser.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> > $_ptbKeywords").value = "12345"
> > browser.link(:id, 'ctl00_ctl00_searchBox_MessagizedButton1').click
>
> > The above link has an href attribute of
> > "javascript:AjaxSearch_DoSearchRedirect()", so there's some redirect
> > magic going on there.
>
> > COMPARING THE FORM TAGS:
>
> >http://www.jobware.de-  > action="/st/index.html" name="easyfinder">
> >http://www.monster.de-  > action="home.aspx" method="post" name="aspnetForm">
>
> > Since action="home.aspx" in form id="aspnetForm", it looks like the
> > form data is sent to the home page, which then refreshes.
>
> > Hope that helps...
>
> > orde
>
> > On Jun 16, 4:08 am, jason  wrote:
> > > Orde,
> > > thanks for looking at this.
> > > unfortunately thats not the answer - maybe even a little off track.
>
> > > I am getting a lot cases where form.submit does not work as expected.
>
> > > another case iswww.monster.de
>
> > > ff.form(:index, 1).text_field(:name, "ctl00$ctl00$searchBox
> > > $_ptbKeywords").value = "12345"
> > > ff.form(:index, 1).submit
>
> > > The page renders no result from the form.submit (just a page
> > > refresh).
>
> > > I thought that this might have something to do with the fact that that
> > > the form has no submit buttons in it - so tried a from that does have
> > > input buttons defined:
>
> > >https://careers3.accenture.com/taleo/taleo.asp?countryname=Germany
>
> > > ff.frame(:index, 1).form(:index, 1).text_field(:name,
> > > "jobNumberSearch").value = "12345"
> > > ff.frame(:index, 1).form(:index, 1).submit
>
> > > also here, the page renders no result from the form.submit (it just
> > > refreshes the page)
>
> > > however, this page works just fine:
>
> > >http://www.jobware.de/
>
> > > ff.form(:index, 1).text_field(:index, 1).value = "ruby"
> > > ff.form(:index, 1).submit
>
> > > and because i thought it might have somthing to do with iframes being
> > > declaired on in the page i built a html document with the google
> > > search page in the iframe,
> > > that also worked as expected.
>
> > > So I really am stuck on why. I cannot figure out what the causing this
> > > behaviour - it least if I knew,  could try fixing it.
> > > has anyone got any ideas? I am more looking for the cause, rather than
> > > a work around.
>
> > > thanks a million.
>
> > > Jason.
>
> > > On 15 Jun., 22:43, orde  wrote:
>
> > > > Looks like it's a cross-domain issue.
>
> > > > This code:
>
> > > > browser = Watir::IE.start('http://www.adecco.de/GERMAN/candidates/
> > > > jobsuche/Pages/DEJobSuche.aspx')
> > > > puts browser.show_frames
>
> > > > yields this message:
>
> > > > frame index: 1 Access Denied, seehttp://
> > wiki.openqa.org/display/WTR/FAQ#access-denied
>
> > > > So, check outhttp://wiki.openqa.org/display/WTR/FAQ#access-denied.
> > > > There are a few workarounds listed there (e.g. go directly to frame
> > > > URL, add URL to browser's trusted sites, tweak etc/host file).
>
> > > > Hope that helps.
>
> > > > orde
>
> > > > PS: I'm using IE7 + watir 1.8.6 + ruby 1.6.2.
>
> > > > On Jun 15, 8:08 am, jason  wrote:
>
> > > > > HI I have a simple case that i cannot seem to make work. i.e. fill
> > out
> > > > > a form and submit it and see a new resulting page.
>
> > > > > here the real example:
>
> > > > > ff.goto("http://www.adecco.de/GERMAN/candidates/jobsuche/Pages/
> > > > > DEJobSuche.aspx")
> > > > > ff.frame(:index, 1).form(:index, 1).text_field(:index , 1).set
> > > > > ("hello")
> > > > > ff.frame(:index, 1).form(:index, 1).submit
>
> > > > > the submit_form method in firewatir does get called and the browser
> > > > > does recieve the .submit command but
> > > > > the page just rebuilds the form - even with the word hello that i set
> > > > > it with.
>
> > > > > and ideas why a page is not being generated.
>
> > > > > hoping that i am missing somthing very simple.
>
> > > > > thanks for your help
>
> > > > > jason.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Wati