Hi Zeljko,
Yeah thats true.Because of that extra space watir was not
able to recognize the text.I was recording the events
using watir webrecorder0.4.It was recording one extra
space for text.Here i am sending code of _javascript_ file.
Can i automate it using formname.
Here is the script recorded by webrecorder.

## Generated by Watir WebRecorder 0.4
## Recorded on Wednesday, March 8, 2006, at 11:00 AM
#includes
require 'watir'   # the controller
require 'watir/WindowHelper'
include Watir

#test::unit includes
require 'test/unit'

class TC_recorded < Test::Unit::TestCase

 def test_1
  $IE0 = IE.new

  $IE0.goto("http://nebo.applabs.net/")
  $IE0.wait

  $IE0.link( :text, "Nebo GA 1.0 ").click

  $IE0.wait

  $IE0.link( :text, "Nebo Login ").click

  $IE0.form( :name, "loginForm").text_field( :name, "login").set("nbdemo")

  $IE0.form( :name, "loginForm").text_field( :name, "passwd").set("nbdemo")

  $IE0.form( :name, "loginForm").button( :name, "log").click

  $IE0.wait

 end
end

Here is the _javascript_ file code:


var str_loginForm = "" +
"<span class=n_msg>" +
"<form name=loginForm>" +
"Please enter the login-id and password to access the system" +
"<br><br>" +
"<table class=n_field>" +
"<tr><td>" +
"Login Id" +
"</td><td>" +
"<input type=text name=login +
"(min 6 chars)" +
"</td></tr>" +
"<tr><td>" +
"Password" +
"</td><td>" +
"<input type=password name=passwd >" +
"(min 6 chars)" +
"</td></tr>" +
/*"<tr><td>"+
"</td><td align=left>"+
"<input type=checkbox name=remember value=1>Remember Me"+
"</td></tr>"+*/
"<tr><td>" +
"&nbsp;" +
"</td><td align=left>" +
"<input type=button name=log value=Login >" +
"</td></tr>" +
"</table>" +
"</form>" +
"</span>" ;
 
Thanks in advance.
Tanu
 
 
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to