Kantu V5: Dont executes all commands in macro

Hello all,

I just upadated today and got some error if I start my Testsuites over the commandline. The manuall start works just fine.

Some commands are executed multiple times and some other not once.

Here you can see my macro as JSON

{
  "Name": "login",
  "CreationDate": "2019-6-4",
  "Commands": [
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "deleteAllCookies",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${!cmd_var1}",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "${!cmd_var1}",
      "Value": ""
    },
    {
      "Command": "assertElementPresent",
      "Target": "xpath=/html/body/div[2]/div[2]/form/div",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "/html/body/div[2]/div[2]/form/div",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=Username",
      "Value": "XXXXXXX"
    },
    {
      "Command": "type",
      "Target": "id=Password",
      "Value": "XXXXXXX"
    },
    {
      "Command": "click",
      "Target": "/html/body/div[2]/div[2]/form/div",
      "Value": ""
    },
    {
      "Command": "clickAndWait",
      "Target": "/html/body/div[2]/div[2]/form/div/button",
      "Value": ""
    },
    {
      "Command": "captureEntirePageScreenshot",
      "Target": "login",
      "Value": ""
    },
    {
      "Command": "localStorageExport",
      "Target": "login.png",
      "Value": ""
    }
  ]
}

and here the log.

Status=Error: timeout reached when looking for element ‘xpath=/html/body/div[2]/div[2]/form/div’

[status] Playing test suite Component_Fieldtemplate
[status] Playing macro login
[status] Playing test suite Component_Fieldtemplate
[status] Playing macro login
[status] Playing test suite Component_Fieldtemplate
[status] Playing macro login
[status] Playing test suite Component_Fieldtemplate
[status] Playing macro login
[info] Executing: | pause | 5000 | |
[info] Executing: | pause | 5000 | |
[info] Executing: | pause | 5000 | |
[info] Executing: | pause | 5000 | |
[info] Executing: | assertElementPresent | xpath=/html/body/div[2]/div[2]/form/div | |
[info] Executing: | assertElementPresent | xpath=/html/body/div[2]/div[2]/form/div | |
[info] Executing: | assertElementPresent | xpath=/html/body/div[2]/div[2]/form/div | |
[info] Executing: | assertElementPresent | xpath=/html/body/div[2]/div[2]/form/div | |
[error] timeout reached when looking for element ‘xpath=/html/body/div[2]/div[2]/form/div’/div’

As you can see the pause and the assertElementPresent are multipletimes in the log but the type of the Username and Passwort not once. Also the simple echo is not logged.

This macro worked in the previouse version.

I just noticed that every fourth command is 4 times executed, started by the first one.
So my first pause command is executed for the following 3 commands.

Command > Log

1 pause 5000 > [info] Executing: | pause | 5000 | |

2 deleteAllCookies > [info] Executing: | pause | 5000 | |

3 echo öffne: ${!cmd_var1} > [info] Executing: | pause | 5000 | |

4 echo ${!cmd_var1} > [info] Executing: | pause | 5000 | |

Then the fifth command is also 4 times executed

1 open {!cmd_var1} > [info] Executing: | open | {!cmd_var1} | |

2 assertElementPresent… > [info] Executing: | open | ${!cmd_var1} | |

3 click … > [info] Executing: | open | ${!cmd_var1} | |

4 type id=Username > [info] Executing: | open | ${!cmd_var1} | |

and so on

Strange. Some questions:

  1. Does this happen with all testsuites or just a specific one?

  2. If you use the same macros in a new “folder as testsuite” testsuite and use the “-folder” switch to run it, does it work then?

Thanks for the fast reply,

I get this error in different testsuites.
If I start it with the folder switch I get the following log:

Status=Error: Error #101: Kantu is not connected to a browser tab

[status] Playing test suite test
[status] Playing macro login
[info] Executing: | pause | 5000 | |
[status] Playing test suite test
[status] Playing macro login
[status] Playing test suite test
[status] Playing macro login
[status] Playing test suite test
[status] Playing macro login
[info] Executing: | pause | 5000 | |
[info] Executing: | pause | 5000 | |
[info] Executing: | pause | 5000 | |
[info] Executing: | echo | {!cmd_var1} | | [echo] http://zs12.zoller-d.com/ZollerWebTMS_Jenkins/ [info] Executing: | open | {!cmd_var1} | |
[info] Executing: | open | {!cmd_var1} | | [info] Executing: | open | {!cmd_var1} | |
[info] Executing: | type | id=Username | install |
[info] Executing: | type | id=Username | install |
[info] Executing: | click | /html/body/div[2]/div[2]/form/div | |
[info] Executing: | clickAndWait | /html/body/div[2]/div[2]/form/div/button | |
[info] Executing: | clickAndWait | /html/body/div[2]/div[2]/form/div/button | |
[info] Executing: | clickAndWait | /html/body/div[2]/div[2]/form/div/button | |
[error] Error #101: Kantu is not connected to a browser tab
[info] Macro failed (Runtime 15.42s)

So it seems a bit better but not like its without any failure.
But with folder option it executes the commands, although they are not logged. the id=password gets an value from kantu but as you can see the logging of the password is missing.

I detected another behaviour.
If I delete all outcommented commands it works.