I tried to use the function that you had put up at the link below:
http://aspn.activestate.com/ASPN/Mail/Message/ruby-talk/3690066
Made a few changes though:
def element *args
arg1, arg2 = args # this is needed so hashes would work as input
elements =
[ :table, :link, :cell, :image, :checkb
Hello.
As I answered to your question in Ruby-Forum, I'm going to paste the
answer here also. I used different approach than xpath, since I've
discovered that XPath in Watir+IE is really-really slow. I haven't
benchmarked my current solution, but last time I tried something like
text_field(:name,
Thanks very much. I study from you again, :)
Thanks.
Wesley Chen.
On Wed, Jan 14, 2009 at 11:59 AM, Richard Lawrence wrote:
>
> You don't get back the specific object type from element_by_xpath, so
> some methods don't work. But this works:
>
> b = Watir::IE.new
> b.goto 'http://www.google.com/'
Thanks a lot.
On 14 ene, 03:59, Richard Lawrence wrote:
> You don't get back the specific object type from element_by_xpath, so
> some methods don't work. But this works:
>
> b = Watir::IE.new
> b.goto 'http://www.google.com/'
> txt = b.element_by_xpath("//*...@name='q']")
> txt.value = 'Richard
You don't get back the specific object type from element_by_xpath, so
some methods don't work. But this works:
b = Watir::IE.new
b.goto 'http://www.google.com/'
txt = b.element_by_xpath("//*...@name='q']")
txt.value = 'Richard Lawrence'
btn = b.element_by_xpath("//*...@name='btnG']")
btn.click
S
We can't use "set", "exists?" and many other methods after comment
:element_by_xpath
Thanks.
Wesley Chen.
On Wed, Jan 14, 2009 at 12:46 AM, TCBlues wrote:
>
> Thanks for your answer.
>
> In the case the object is a textField or a listField I'm trying to set
> the control with:
> ie.element_by_
Thanks for your answer.
In the case the object is a textField or a listField I'm trying to set
the control with:
ie.element_by_xpath("//*...@name="imp1"]").set("testing")
but an error comes up: 13:in `method_missing': unknown property or
method `set' (WIN32OLERuntimeError)
--~--~-~--~-
Hi!
The only way I know to do this would be to perform an exists? check on
the various objects that this could be and click it if it exists.
if ie.button(:name, 'imp1').exists?
ie.button(:name, 'imp1').click
elsif ie.link(:name, 'imp1').exists?
ie.link(:name, 'imp1').click
end
Hope this h
This ought to do it:
require 'watir'
include Watir
ie=IE.new
ie.goto("file://c:/temp2.htm")
ie.element_by_xpath("//*...@name='imp1']").click()
Richard
--
Richard Lawrence
Certified Scrum Coach
Founder and Principal Consultant, Humanizing Work, LLC
303-895-7688
rich...@humanizingwork.co