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

2009-06-18 Thread Natasha Ranney
Hey orde,

You are right. There is an object tag associated with it and that button is a 
Flash implementation.

I have come across that we have flash supported extension for watir flashwatir. 
Just was wondering if its useable. 
Or is there an alternative solution like using some windowsole api to handle 
this.

Thanks,
Natasha





From: orde ohil...@gmail.com
To: Watir General watir-general@googlegroups.com
Sent: Thursday, 18 June, 2009 1:33:32
Subject: [wtr-general] Re: Automating a File uploader popup


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 object 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] Re: Automating a File uploader popup

2009-06-18 Thread orde

I briefly tried flash-watir, but it's firefox only.

I know that Selenium has some flash-testing capacity, but I haven't
tried it.

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

a href=# class=linkbutton alt
span class=left/span
span id=spnUploadButton class=middleUpload your images to 
MOO/span
span class=right/span
/a

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 aleks.kiev...@gmail.com
To: Watir General watir-general@googlegroups.com
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: 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 object 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] Re: Automating a File uploader popup

2009-06-16 Thread Željko Filipin
On Tue, Jun 16, 2009 at 10:47 AM, Natasha itsn...@yahoo.co.uk wrote:
 One of the links on our company website invokes a file uploader popup
 window.

This does not work?

http://wiki.openqa.org/display/WTR/File+Uploads

Ž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-16 Thread Natasha Ranney
Hi

Thanks for the pointer. 

Unfortunately I don't think it will help, as it looks for HTML tag input
type = file :(

But following is the piece of code that invokes the popup in my case:


div
a href=# class=linkbutton alt
span class=left/span
span id=spnUploadButton 
class=middleUpload your images to MOO/span

span class=right/span
/a
/div

And the above is using a Flash method to invoke File uploader.
Thanks,
Natasha





From: Željko Filipin zeljko.fili...@wa-research.ch
To: watir-general@googlegroups.com
Sent: Tuesday, 16 June, 2009 12:46:15
Subject: [wtr-general] Re: Automating a File uploader popup

On Tue, Jun 16, 2009 at 10:47 AM, Natasha itsn...@yahoo.co.uk wrote:
 One of the links on our company website invokes a file uploader popup
 window.

This does not work?

http://wiki.openqa.org/display/WTR/File+Uploads

Ž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-16 Thread George

Hi Natasha,

Have you tried file_field?

browser = Watir::IE.attach(...)
browser.file_field(:id,open_file).set(filepath)


On Jun 16, 6:26 am, Natasha Ranney itsn...@yahoo.co.uk wrote:
 Hi

 Thanks for the pointer.

 Unfortunately I don't think it will help, as it looks for HTML tag input
 type = file :(

 But following is the piece of code that invokes the popup in my case:

 div
                         a href=# class=linkbutton alt
                                 span class=left/span
                                 span id=spnUploadButton 
 class=middleUpload your images to MOO/span

                                 span class=right/span
                         /a
                 /div

 And the above is using a Flash method to invoke File uploader.
 Thanks,
 Natasha

 
 From: Željko Filipin zeljko.fili...@wa-research.ch
 To: watir-general@googlegroups.com
 Sent: Tuesday, 16 June, 2009 12:46:15
 Subject: [wtr-general] Re: Automating a File uploader popup

 On Tue, Jun 16, 2009 at 10:47 AM, Natasha itsn...@yahoo.co.uk wrote:
  One of the links on our company website invokes a file uploader popup
  window.

 This does not work?

 http://wiki.openqa.org/display/WTR/File+Uploads

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