Hey Hrishikesh,

   Try inserting a delay after the ie.goto  step.  Simplest one is use the 
command "sleep <Amount of time to delay>". E.g. sleep 5 (The code will wait for 
5 secs before executing the next step).  Although, note this is not the best 
solution.



Regards,
Rahul

From: [email protected] [mailto:[email protected]] On 
Behalf Of Hrishikesh Bose
Sent: 23 September 2010 15:48
To: [email protected]
Subject: [wtr-general] Script runs well in irb, but not when i run it using as 
a whole


hello friends. i have a unique problem facing in my automation script. First 
let me give you a brief abt the app

its a login page implemented in frames, So the whole implementation if you see 
in the iedeveloper tool bar will be

[-]HTML
   [+]<HEAD>
   [+]<FRAMESET>


now all the page content is inside this frameset tag using TD, TR, DIV etc.

----------
following is the code i have written

require "rubygems"
require "Watir"
url="http://ipaddress:8080/ManagementPortal/";
ie=Watir::IE.new
ie.goto url
ie.frame(:src,"./app").text_field(:id,"c_nameFieldId").set "admin"
ie.frame(:src,"./app").text_field(:id,"c_passwordFieldId").set "444001"
ie.frame(:src,"./app").button(:id,"c_loginSubmitButtonId").click

----

this works fine when i run them individually through IRB> also used flash to 
highlight the objects which works fine. but when i copy it in a test.rb file 
and run it as "ruby test.rb",  the when page does open, but following error is 
through in the dos prompt

by187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in 
`assert_exists': Unable to locate element, using :id, "c_nameFieldId" 
(Watir::Exception::UnknownObjectException)
   from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in 
`enabled?'
   from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in 
`assert_enabled'
   from 
C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:327:in
 `set'
   from ANS Automation.rb:7


can someone tell me what to do?

---------------
--
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to