[Wtr-general] Incrementing object names
Paul Carvalho
tester.paul at gmail.com
Tue Aug 8 13:58:16 EDT 2006
I use similar mixed variables in my scripts but I use the 'succ' method
rather than trying to manually figure it out.
For your sample code below, I might rework it to something like:
def enter_data
x = 0 ; object_name = 'A10'
read_in_test_data...
...
object_name.succ!
p object_name
...
end
Hope this helps. Paul.
On 08/08/06, aidy rutter <aidy.rutter at gmail.com> wrote:
>
> At the moment I am trying to add 0 or 1 onto 'A11' like this
>
>
> def enter_data
> x=0
> read_in_test_data.each { |x|
> line = x.chomp
> next if line.upcase == 'ADDRESS:'
>
> object_name = 'A' & "#{11+x}"
>
> p object_name
> $ie.text_field(:name, object_name).set(line)
> x+=1
> }
> end
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060808/a264a3b2/attachment.html
More information about the Wtr-general
mailing list