Re: [Wtr-general] $ie.button replacing with $ie.b?
Try the send method, which invokes the method named by the first argument and passes it any succeeding parameters. To use your example: b = 'button' puts $ie.send(b, :index,1) ___ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] $ie.button replacing with $ie.b?
i want to do something like this:
def check_elements(ie,elements,btn,lnk)
for i in 1 .. elem[1,0]
if ( ie.elements[0,0](:index,btn[i-1,0]).exist? and
ie.elements[0,0](:value,btn[i-1,1]) and ie.elements[0,0](:name,btn[i-1,2]) )
then
write("The button with value: "+ btn[i-1,2] + " exist and
not disabled",1)
else
write("The button with value: "+ btn[i-1,2] + " does not
exist ",0) # write is a def with file.puts...
end # if exist
end # for i
end #def
elements=Matrix[
["button","link","select_list"...]
[2,6,1] #number of buttons,links etc
]
buttons=Matrix[
[1,"","Web Search"], # index, name and value
[2,"","Go"],
]
links=Matrix
check_elements(ie,elements,buttons,links)
I want to verify all elements just by calling check_elements procedure and
editing an txt file where the buttons, links ..indexes, values and names are
This is just a simple example; the check_elements procedure it will be more
complex, at least that i want.
Tnx for help
___
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] $ie.button replacing with $ie.b?
I'm not quite sure why you'd want to do that, maybe you could explain it.
Here are a couple of random possibilities:
1. use the string and eval it, makes the code less readable but there are
some good uses for this:
b = "button"
eval("puts $ie.#{b}(:index, 1)")
2.wrap the code in a method, cleaner access and sets you up for methods on
your pages which you can roll into classes for your pages:
def my_form_button; $ie.button(:index, 1);end
puts my_form_button
my_form_button.click
It all depends on what the context of the question is and where you might
want to take it.
-Charley
On 7/7/07, mihai <[EMAIL PROTECTED]> wrote:
cand i do something like this, and how:
b="button"
puts $ie.b(:index,1)
instead of puts $ie.button(:index,1)
___
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] $ie.button replacing with $ie.b?
cand i do something like this, and how: b="button" puts $ie.b(:index,1) instead of puts $ie.button(:index,1) ___ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
