fun4uoc
Supreme Member
- Dec 25, 2007
- 1,205
- 1,049
Just started playing around with Ruby and have run into an issue.
I have it hardcoded to pull a random name and store it in a variable.
This works fine when checking with puts, however, when I run it it enters this in the field. ["Joyce"]
If I just do it like this it works fine.
I've tried pulling names from a txt and csv file with the same results. Tried several methods i've found on google to remove the [""] but they all caused the bot to not even run.
Any ideas?
Thanks
I have it hardcoded to pull a random name and store it in a variable.
Code:
firstname = "Becky","Mary","Anabel","Geneva","Margart","Christina","Diane"
first = firstname.sample(1)
wd.find_element(:id, "first_name").send_keys "#{first}"
This works fine when checking with puts, however, when I run it it enters this in the field. ["Joyce"]
If I just do it like this it works fine.
Code:
wd.find_element(:id, "first_name").send_keys "Joyce"
I've tried pulling names from a txt and csv file with the same results. Tried several methods i've found on google to remove the [""] but they all caused the bot to not even run.
Any ideas?
Thanks
Last edited: