I want to automate this text field.

A

Asha Latha

Hi

I want to automate this text field.

ie.text_field:)name, "JMSText").set('TEST').

Instead of TEST i want to copy content from text file and paste it in
text filed.

if i change the text in notepad ..it shoudl take the new value

Pleae help regarding this


Regards
Asha
 
S

Suraj Kurapati

Asha said:
ie.text_field:)name, "JMSText").set('TEST').

Instead of TEST i want to copy content from text file and paste it in
text filed.

Use the File::read() method:

file_path = "path to your file.txt"

file_contents = File.read(file_path)

ie.text_field:)name, "JMSText").set(file_contents)
if i change the text in notepad ..it shoudl take the new value

With the above approach, you must rerun your Ruby program after changing
the text in notepad.

If you wish to have your Ruby program respond to changes in the text
file while it is still running, then take a look at libinotify.
 
A

Asha Latha

Hi

Thanks its working.

But i want to read first line and then paste that one to text filed,
once it is done i will read second line and so on....

Please help me to solve this.

Regards
Asha
 
7

7stud --

Asha said:
Hi

Thanks its working.

But i want to read first line and then paste that one to text filed,
once it is done i will read second line and so on....

Please help me to solve this.

Regards
Asha

IO.foreach("file_name") do |line|
...stuff here
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top