Hi Helge,

It's not late at all. :-)

And thanks for confirmation.

I've fixed the sub wNavigatorAuswahl. Please get it in attachment.

What I did:
1. Change the virable name to English. (more readable for people outside 
Germany)
2. Move the Yellow instruction out side of if...end if
3. Deleted the Red instructions.
I'll explain it below.

After I fixed the script, I found a problem, tInsertNote need modify.
Under Linux, a delay needed before we set the note. Or the text will not be 
written in the note area, but be written in the document. Because of the defect 
in sub wNavigatorAuswahl, This never be discovered. I'm not sure if this is a 
performance issue under linux.
At least wait(50) is needed for my computer. I tried wait(40), the note 
sometimes doesn't work.

And I modified the warnlog to make it more specific.

If there are mistakes, please let me know, Thank you!

Best regards,
Lihua

--------------------Below is the explaination.------------------------

testcase tInsertNote
     dim sNoteText as String
      PrintLog "- Insert / Note"
  
      Call hNewDocument
      printlog " Insert / Note"
      InsertNoteWriter
      Kontext "DocumentWriter"
      sNoteText = "Testnote inserted by testtool !"
      Call wTypeKeys (sNoteText)
wait(50)                                 //A delay needed here under linux, is 
this a performance issue? 
      Call wNavigatorAuswahl( 11, 1 )                    
      Kontext "NavigatorWriter"
      if Auswahlliste.Gettext <> sNoteText then
warnlog ("Note was not inserted correctly. Expected: " + sNoteText +" Got: " + 
Auswahlliste.Gettext)
                                      // WAS: warnlog ("Note was not inserted 
correctly (Focus problem?")
      end if
      printlog " Check if note exists"
      printlog " Close active document"
      Call hCloseDocument
endcase


sub wNavigatorAuswahl(Gruppe as integer, Eintrag as integer,optional LeaveFocus 
as boolean)
    dim j as integer, WelcherEintrag as integer
    Dim MinEntrys as integer
    If IsMissing(LeaveFocus) = True then LeaveFocus = False
    Select Case Ucase(gApplication)
                ...
            Case "MASTERDOC"
            Kontext "NavigatorGlobalDoc"
            if NavigatorGlobalDoc.NotExists then EditNavigator
            wait 500
            Kontext "NavigatorGlobalDoc"                      
            if Liste.IsVisible then                                
                Kontext "GlobaldokumentToolbox"
                Umschalten.Click
                Kontext "NavigatorWriter"        //Move it out side of if...end 
if. It must be Kontexted in spite of which navigator is showing.
            end if
            MinEntrys = 11
        Case Else ' for all others!!!!
            Warnlog "Not supported application!"
            exit sub
    end select
Sleep 2
    Select Case Ucase(gApplication)
             ...
        Case "MASTERDOC"
        if Liste.IsVisible = True then   //Deleted, We Kontext 
"NavigatorWriter" few instructions before, no need to judge which navigator 
this is.
            Umschalten.Click              //Liste will never exist here, and we 
can't judge it by Auswahlliste.IsVisible, because both the navigator have
        end if                                 //this control. From this 
section I can make it sure that the scripts after this section have no chance 
to 
        if Auswahlliste.GetItemCount >MinEntrys then    // operate with a 
NavigatorGlobalDoc. So I'm sure it can be deleted and the above Kontext
             For j= 1 to 12                                         //statement 
can be move outside.
                 Auswahlliste.Select j
                 Auswahlliste.TypeKeys "-"
            next j
        end if
        Auswahlliste.Select Gruppe
        if Eintrag >0 then
            WelcherEintrag = Gruppe + Eintrag
            Auswahlliste.TypeKeys "+"
            Auswahlliste.Select WelcherEintrag
            Auswahlliste.TypeKeys "<Return>"
        end if
    end select
...
end sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to