Welcome to Ruby and Watir. Glad you jumped in. It's a great language and Watir is a nice library.
about your issue: you may try right after you login click to capture the html and see what's there; try with; puts ie.html.inspect after ie.button(how, what).click line Another possible issue may be a hidden frame (frameset). Just a wild guess since I've seen it happen in a couple of apps I worked with. Also I noticed that the HTML generated by IEDeveloperToolbar is not really the HTML that's on the page. The IEDevToolbar adds its own head info for meta doctype and styles. marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Tue, Mar 17, 2009 at 10:05 AM, Mark Lehky <mark.le...@aclaro.com> wrote: > > Hello all. > > I am new to Watir as well as Ruby, but have had experience with other > tools and languages. Installed Ruby+Watir (no issues), ran through the > basic tutorial, everything worked just fine. > > I then tried to create the first test for my AUT. The test was quite > simple: login and try to locate some text on the next page. > The login portion worked: found the two text boxes > (username/password), found the login button. However, the next page is > effectively blank to Watir. For any element that I tried to .flash, I > always got the error: > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in > `assert_exists': Unable to locate element, using :id, "c_ddlCategory" > (Watir::Exception::UnknownObjectException) > from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:239:in > `flash' > from petroLook_login.rb:15 > > After searching through past posts here, I was led to Webmetrics RIA > Script Recorder. That tool cannot "see" of the elements either - > nothing is recorded after the login page. :( > > Here is my sample Watir test: > require "watir" > test_site = "http://localhost/petroLook4410" > ie = Watir::IE.new > ie.goto test_site > if ! ie.text.include? "Login" > puts "Test Failed! Could not find: 'Login'." > exit 1 > end > ie.text_field(:id, "c__txtUsername").set "bootstrap" > ie.text_field(:id, "c__txtPassword").set "bootstrap" > ie.button(:id, "c__btnLogin").click > # everything past this point is "gone" > if ! ie.text.include? "Activating the database" > puts "Test Failed! Could not find: 'Activating the database'." > exit 1 > end > puts "All good!" > exit 0 > > Here is the HTML code snippet grabbed from IE Developer Toolbar of the > above text (I wonder how e-mail clients are going to handle this - I > am typing this in plaintext-mode): > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN"> > <META http-equiv="Content-Type" content="text/html; charset=windows-1252"> > <HTML class=" page" id="html"> > <HEAD> > <STYLE> /* No matching styles were found. */ </STYLE> > </HEAD> > <BODY class=" page ie" id="body"> > <FORM id="frmControlHost" name="frmControlHost" > > action="WebPages_ControlHost.aspx?control=aclaro.petroLook.WebControls.Generic.PageHost&pagetype=Admin&category=Bootstrap&group=Schema" > method="post"> > <P>Activating the database enables petroLook users to log in and > disables the bootstrap user. </P> > </FORM> > </BODY> > </HTML> > > TIA for any help. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to firstname.lastname@example.org Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---