Hi, Please try this solution
ie = Watir::IE.start("http://www.test.com") file = File.open("c:/test.txt", "r") lines = file.readlines 1st_value_1st_row=lines[0].split[0] 2nd_value_1st_row=lines[0].split[1] 1st_value_2nd_row=lines[1].split[0] 2nd_value_2nd_row=lines[1].split[1] You can use it in watir like ie.text_field(:name, "subsets_.Name_").value = 2nd_value_1st_row Thanks Raveendran P On Wed, Sep 7, 2011 at 9:02 AM, byung <jinuacad...@gmail.com> wrote: > Below is the code I use to append data in a local text file into the > text_field on the web page. > > How should I change the code below in order to append the second value > in the text file delimited by ; in another text_field on the web > page?? > > now.. the test.txt file has the below values: > > test1 > test2 > ... > > New test.txt file will have the values, > > test1; 2nd_test1 > test2; 2nd_test2 > > I wish 2nd_test1, 2nd_test2 values appended to the 2nd text_field > > text_field(:name, "subsets_.Name2_") > > on the web. > > Could anyone please tell me how I should update the code below in > order to realize that? > > Thank you so much. > > --------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > require 'watir' > > ie = Watir::IE.start("http://www.test.com") > > file = File.open("c:/test.txt", "r") > lines = file.readlines() > > 0.upto(lines.length - 1) {|j| > > $Guide = lines[j] > > ie.text_field(:name, "subsets_.Name_").value = $Guide > > ie.button(:alt, "Save").click > > } > > file.close() > lines.clear() > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com> > -- Regards, P.Raveendran http://raveendran.wordpress.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com