[Wtr-general] Error clicking a button...

Cain, Mark Mark_Cain at RL.gov
Fri Sep 1 11:01:38 EDT 2006


What appears to be happening is the $ie object is not retaining the page
objects during the attachment to the non-modal window (I am probably not
describing this right).  Because when I put these two line of code:

table = $ie.table(:index, 8)

      table[1][5].click

 

Immediately after when the non-modal window closes, I no longer get the
error and the script completes as expected.  What the two lines of code
do is to re-click the tab which causes the page to reload.

 

I posted my test case as it was when failing but I can't post the web
page because there are security and propriety issues.  

 

Failing Test Case:



    def test5_ca

      table = $ie.table(:index, 8)

      table[1][5].click

#$ie.show_all_objects

      $ie.button(:id, 'EnterEditCorrectiveActions').click

      sleep 3

 

      cw2  = IE.attach(:title, /PER CA Management/i)

      

      cw2.button( :index, 3 ).click

      cw2.text_field( :index, 1 ).set("^CH2M")

      cw2.button("Search").click

      cw2.selectBox( :index, 1 ).select_value(/15319/)

      cw2.text_field( :index, 2 ).set("#{$d}")

      cw2.text_field( :name, "Action" ).set('Actions to be taken for
this')

      

      startClicker("OK" , 3)

      cw2.button("Save").click

      

      sleep 1 unless $ie.status == 'Done'

      

      cw2.button("Close Window").click_no_wait

 

      while $ie.status != 'Done'

        sleep 1

      end

 

      

      $ie.text_field( :name, "DescriptionofOccurrence"
).set('Description of Occurrence Text')

      $ie.text_field( :name, "Extent" ).set('Extent Text')

      $ie.text_field( :name, "SafetySig").set('Safety Significance
Text')

      #$ie.text_field( :name, "GenericImp" ).set('Generic Implications
Text')

      $ie.text_field( :name, "RemedialCA" ).set('Remedial Corrective
Actions Text')

      $ie.text_field( :name, "ApparentCauseAnalysis" ).set('Apparent
Cause Analysis Text')

      

#$ie.show_all_objects

      sleep 1

      

$ie.button('Save').click  # Fails HERE

          

      assert($ie.text_field(:name,
"DescriptionofOccurrence").verify_contains("Description of Occurrence
Text"))

      assert($ie.text_field(:name, "Extent").verify_contains("Extent
Text"))

      assert($ie.text_field(:name, "SafetySig").verify_contains("Safety
Significance Text"))

      assert($ie.text_field(:name,
"RemedialCA").verify_contains("Remedial Corrective Actions Text"))

      assert($ie.text_field(:name,
"ApparentCauseAnalysis").verify_contains("Apparent Cause Analysis
Text"))

      

      startClicker("OK" , 3)

      #sleep 1

      $ie.button("Submit").click

     

      $ie.link(:text, /PER-2006-/i).click

      

    end

 

--Mark

 

________________________________

From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker
Sent: Thursday, August 31, 2006 12:12 PM
To: wtr-general at rubyforge.org
Subject: Re: [Wtr-general] Error clicking a button...

 

Hey Mark, 

  It's good you're trying to track down the error by process of
elimination, somehow not something that occurs to a lot of people. It's
a bit hard to pin down what's happening remotely without some more
information. Try posting your script code and possibly some part of the
html. 

-Charley 

On 8/31/06, Cain, Mark <Mark_Cain at rl.gov> wrote:

Here is a curious addition to my previous post.  If I put an
"$ie.show_all_objects" at the top of the test case then all the object
on the page are displayed in the output-as expected, nothing curious
here.  However, if I move the "$ie.show_all_objects" method to after
where the Non-modal windows closes then only a very small part of the
object show in the output, and then the error.

 

--Mark

 

________________________________

From: wtr-general-bounces at rubyforge.org
[mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark
Sent: Thursday, August 31, 2006 10:46 AM
To: wtr-general at rubyforge.org
Subject: [Wtr-general] Error clicking a button...

 

I am getting the following error when I click a 'Save' button on a page.
The application has several tabbed pages and on each is the same 'Save,
Submit, and Clear' button pattern.  The other tab pages click the save
button without error.  This error occurs after attaching and closing a
Non-modal window.  

 

NoMethodError: undefined method `all' for nil:NilClass

    C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1257 :in
`ole_inner_elements'

    C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1313 :in
`locate_input_element'

    C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3608 :in `locate'

    C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2337 :in `assert_exists'

    C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2480 :in `click'

    C:/watir_bonus/working/PER/tc_PERwResloution_test.rb:279 :in
`test5_ca'

 

Has anyone else seen this or similar behavior?

____________________
Mark L. Cain
LMIT - E *STARS (r) ~ Lead Test Engineer 
1981 Snyder, MSIN: G3-62, Richland, WA 99354
Mark_Cain at RL.gov
509.376.5458
"640 Kilobytes of computer memory ought to be enough for anybody." -
Bill Gates, 1981 

 


_______________________________________________
Wtr-general mailing list
Wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060901/6626b0f8/attachment-0001.html 


More information about the Wtr-general mailing list