i).exists? id = @b.text_field(:cols -6ren">
gpt4 book ai didi

ruby - 如何使用 watir-webdriver 从 text_area 调用 id?

转载 作者:太空宇宙 更新时间:2023-11-03 16:31:39 25 4
gpt4 key购买 nike

for i in 0..10
if @b.text_field(:cols => "40", :index => i).exists?
id = @b.text_field(:cols => "40", :index => i)
if profile_profile_qualifications_attributes_new_(\d)+_comment/.match(id)
@b.text_field(:cols => "40", :index => i).set "Rock!"
end
end
end

上面的代码失败了

Error: can't convert Watir::TextField to String (TypeError)

最佳答案

id = @b.text_field(:cols  => "40", :index => i).id

关于ruby - 如何使用 watir-webdriver 从 text_area 调用 id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14856880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com