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

Cain, Mark Mark_Cain at RL.gov
Tue Sep 5 10:39:49 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

 

_______________________________________________
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/20060905/d894e5a6/attachment-0001.html 


More information about the Wtr-general mailing list