[wtr-general] How to access to onclick attribute

2010-05-05 Thread Rodrigo
Hi guys,

I'm trying to click a button I have on a site I'm working on, but this
button is identified by the following tag and properties:
a onclick=document.selectterm.submit(); href=#Select/a

I've tried to use the different methods to be able to click on the
button but no one was successful.

Do you mind to give me an idea to resolve this problem?

Thanks a lot!!
rODRIGO

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to access to onclick attribute

2010-05-05 Thread Rodrigo
Thanks it worked!!!

Rodrigo

On 5 mayo, 13:59, orde ohil...@gmail.com wrote:
 Try something like this:

 browser.link(:text, text).fire_event('onclick')

 For 
 reference:http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557

 orde

 On May 5, 7:16 am, Rodrigo rodrigo.bert...@gmail.com wrote:





  Hi guys,

  I'm trying to click a button I have on a site I'm working on, but this
  button is identified by the following tag and properties:
  a onclick=document.selectterm.submit(); href=#Select/a

  I've tried to use the different methods to be able to click on the
  button but no one was successful.

  Do you mind to give me an idea to resolve this problem?

  Thanks a lot!!
  rODRIGO

  --
  Before posting, please readhttp://watir.com/support. In short: search 
  before you ask, be nice.

  You received this message because you are subscribed 
  tohttp://groups.google.com/group/watir-general
  To post: watir-general@googlegroups.com
  To unsubscribe: watir-general+unsubscr...@googlegroups.com

 --
 Before posting, please readhttp://watir.com/support. In short: search before 
 you ask, be nice.

 You received this message because you are subscribed 
 tohttp://groups.google.com/group/watir-general
 To post: watir-general@googlegroups.com
 To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: what watir method use with img tag?

2009-11-20 Thread Rodrigo

Thanks a lot!

I'll try that suggestions, but I have tried this way ie.link(:text,
Log In).click and it worked.

What do you think about that method?

Thanks again,
Rodrigo

On 20 nov, 13:46, orde ohil...@gmail.com wrote:
 .image is the correct method.  You might find this page 
 useful:http://wtr.rubyforge.org/rdoc/classes/Watir/Container.html

 Also, this (very useful) page summarizes the methods supported by
 element:

 http://wiki.openqa.org/display/WTR/Watir+Methods+Supported+by+HTML+El...

 Hope that helps.

 orde

 On Nov 20, 7:49 am, Rodrigo rodrigo.bert...@gmail.com wrote:



  Hi everybody,

  I'm having some issues working with img tags. I've tried some methods
  like ie.button, ie.image, ie.click but no one of them works when
  running the watir script.

  This is the html I have:
  img alt=Manage Account src=/img/buttons/navigation/btn-manage-
  account.gif/

  What method can I use for clicking or getting the Manage account
  option.

  Thanks a lor!
  Rodrigo
--~--~-~--~~~---~--~~
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] take screenshot and append to a Word document

2009-11-13 Thread Rodrigo Gomes
Hi,

I'm new in this group (and with Watir, and Ruby too).
I was trying to take a screenshot of some steps that I run with watir and
append them to a word file, but I didn't know how to do it.
Then, I read this thread
http://groups.google.com/group/watir-general/browse_thread/thread/4b50e70019e16097/e51246c551538d3b?lnk=gstq=screenshot#e51246c551538d3b

And this
http://groups.google.com/group/watir-general/browse_thread/thread/e6d656a04303a2df/7892e134acc41e86?lnk=gstq=screenshot#7892e134acc41e86

And I tried the code showed on the first thread (this code:
http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoItakescreenshotsandappendtoaWordfile%3F
)

It worked fine (the example), but when I try to take a lot of screenshots
after some events (like click on a link or button) it
doesn't work.

Let me show you an example. The steps below run perfectly

browser = Watir::Browser.new
browser.maximize
browser.goto myPage
browser.link(:id, linkIncluir).click
browser.frame(:name, popupFrame).text_field(:name, myFieldName).set
some value
browser.frame(:name, popupFrame).button(:value, botaoGravar).click
browser.frame(:name, popupFrame).frame(:name, popupFrame).text.include?
some text

But when I try this one:

browser = Watir::Browser.new
browser.maximize
*screen = TakeScreenShot.new*
browser.goto MyPage
*screen.take_a_screenshot*
browser.link(:id, linkIncluir).click
browser.frame(:name, popupFrame).text_field(:name, myFieldName).set
some value
*screen.take_a_screenshot*
browser.frame(:name, popupFrame).button(:value, botaoGravar).click
browser.frame(:name, popupFrame).frame(:name, popupFrame).text.include?
some text
*screen.save_file*

I got an error saying that the field myFieldName doesn't exist (or was not
found on the page).

The TakeScreenShot code is listed below.

I have no idea why it's happening. What am I doing wrong?

Thanks,
Rodrigo Gomes


*class TakeScreenShot

  def initialize()
  @@word=WIN32OLE.new('Word.Application')
  @@word.Documents.Add()
  @autoit = WIN32OLE.new(AutoItX3.Control)
   end


   def take_a_screenshot
  @autoit.Send({PRINTSCREEN})
  @@word.Selection.Paste
  @autoit.Send({ENTER})
   end

  def save_file

@@word.ActiveDocument.SaveAs('C:\Projetos_ScriptLanguage\ruby\features\support\screenshots.doc')
  @@word.ActiveDocument.close
  @@word.Quit
  end

end



*

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