Search code examples
ui-automationsilktest

What is the mean of [-] and [+] in silktest script


I got a project to convert Silk Test to some other GUI testing framework. I can't understand how the Silk Test script organized by [-] and [+] signs. are there someone help me to understand the meaning? Here is a sample script

        [+] if(AssignSymbolToCatalogNumber.Exists(4))
            [ ] AssignSymbolToCatalogNumber.setActive()
            [ ] Sleep(1)
            [ ] AssignSymbolToCatalogNumber.notMapToCatalog.SetFocus()
            [ ] AssignSymbolToCatalogNumber.notMapToCatalog.Click()
        [ ] WaitForDialogExists (Keep)
        [-] if !Keep1.Exists (1)
            [ ] ResLog.LogFail ("The number {i} Keep dialog did not pop up!")
            [ ] goto EndProgram
        [-] else
            [ ] Keep1.SetActive ()
            [ ] Keep1.RadioList1RL.Select ("#1")
            [ ] Keep1.ShowEditDialogAfterEachCK.Check ()
            [ ] Keep1.OK.Click ()
        [ ] 
        [ ] WaitForDialogExists (InsertEditChildComponent)
        [-] if !InsertEditChildComponent.Exists (1)
            [ ] ResLog.LogFail ("Insert/Edit child component dialog did not pop up!")
            [ ] goto EndProgram
        [-] else
            [ ] InsertEditChildComponent.SetActive ()
            [ ] InsertEditChildComponent.ParentSiblingPB.Click ()
        [ ] 
        [ ] Sleep (1)

Solution

  • In Silk Test's 4Test language, blocks are indicated by an additional tab-character in the indentation, similar to Python.

    The [+] and [-] tags are an indication for the code-editor that a new block begins and also encode the folding status of that block. That means that when you fold that block in the IDE, it will become [-] and if you open it up again, it will become [+].

    For the purpose of running a script they make no difference, it's only relevant for displaying the code.