Próbuję przypisać dane z tablicy do plikustrona internetowa, jednak pojawia się błąd. Wierzę, że błąd oznacza, że nie mogę wstawić flootów w pola tekstowe, więc zmieniłem floot na ciąg znaków. Ale znowu to nie zadziałało. Podałem tylko część kodu, która moim zdaniem była istotna.
Zablokować cytat
eee = Watir::Browser.new
eee.goto(fulllink)
eee.text_field(:name => "txtAttr").set Headings[j]
eee.wait
p = j + 1
strings = body.at(0).at(p)
String (strings)
eee.text_field(:name => "txtValue").set strings
eee.wait
eee.link(:index => 4).click
eee.wait
eee.close
end
i += 1
C:UsersPure.itloaner1-12Google Driveruby>ruby ExST.rb
hello world
Alpha Numeric Unit #
tables filled
200.0
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/input_
elements.rb:356:in `characters_in": undefined method `each_char" for 200.0:Float
(NoMethodError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-c
lassic/input_elements.rb:337:in `type_by_character"
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-c
lassic/input_elements.rb:299:in `set"
from ExST.rb:92:in `<main>"
Odpowiedzi:
0 dla odpowiedzi № 1spróbuj, jeśli się zmienisz String(strings)
do strings = String(strings)
Prace.