Hi
I am using Watir Web Recorder version 0.4 to record click events of our own site.
For recording, web recorder is doing its job properly but watir is not properly playing it back.
does It has limitation of identify forms.For playing it back i need to hand edit the code.
Here are  some codes-:
Code i recorded in google site using webrecorder

## Generated by Watir WebRecorder 0.4
## Recorded on Monday, March 6, 2006, at 11:13 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://www.google.co.in/")
  $IE0.wait

  $IE0.form( :name, "f").text_field( :name, "q").set("ruby")

  $IE0.form( :name, "f").button( :name, "btnG").click

  $IE0.wait

  $IE0.link( :text, "Ruby Home Page").click

  $IE0.wait

  $IE0.wait

  $IE0.close

 end
end

Then it is the hand edit code-:

## Generated by Watir WebRecorder 0.4
## Recorded on Friday, March 3, 2006, at 04:15 PM
#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://www.google.co.in/")
 $IE0.wait

 $IE0.text_field( :name, "q").set("ruby")

 $IE0.button( :name, "btnG").click

 $IE0.wait

 $IE0.link( :text, "Ruby Home Page").click

 $IE0.wait

 $IE0.wait

 end
end

This code working perfectly and playing it back properly.

Again when i am trying this to my site like-:

Recorded from web recorder-:

## 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("mysite")
  $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

Hand edit code-:

## 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("mysite")
  $IE0.wait

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

  $IE0.wait

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

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

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

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

  $IE0.wait

 end
end

When I run this code from command promt it is giving error like

"Unable to locate object using text and Nebo GA 1.0".

I am using Watir-1.4.1 and Ruby 1.8.4.Can you please help.

I am new to work with watir.My application deals with lots of form .Watir is not identifying forms.Please help me why it is  giving problems handling with forms or i am doing anything wrong.Please help.

 

Regards

Tanu



--




_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to