Hello,
I’ve encountered some issues on gotoLabel command, in Katalon Recorder (Chrome).
The 1st time to run the test case, it would go through all the commands between gotoLabel and the label. However, the 2nd run will skip those commands. See following logs:
1st run of Katalon Recorder Samples - gotoIf…gotoLabel…label
[info] Executing: | gotoIf | j < 3 | COMMENT |
[info] Executing: | gotoLabel | END | |
[info] Executing: | type | id=comment | skipped |
[info] Executing: | storeEval | ${k}+1 | k | <= I added this to check if it really runs and works
[info] Executing: | label | END | |
[info] Executing: | type | id=comment | end |
[info] Time: Fri Oct 19 2018 16:44:13 GMT+0800 (China Standard Time) Timestamp: 1539938653877
[info] Test case passed
2nd run of Katalon Recorder Samples - gotoIf…gotoLabel…label
[info] Executing: | gotoIf | j < 3 | COMMENT |
[info] Executing: | gotoLabel | END | |
[info] Executing: | type | id=comment | end |
[info] Time: Fri Oct 19 2018 16:46:17 GMT+0800 (China Standard Time) Timestamp: 1539938777102
[info] Test case passed
Although in this case, it looks commands between “gotoLable” and “label” are conducted but NOT really work in 1st run, but it does cause some problems in my other tests.
type | id=comment | skipped |
storeEval | ${k}+1 | k | <= I added this to check if it is really run
after 1st run, the value of k is still 1.
Does someone hit similar issues? Is there a way to skip those commands in the 1st run?
PS: more screenshots and logs are attached for reference.
Problems_gotoLable_20181019.docx
1 Like
I am seeing the same issue with the record, not sure if it is a 1st vs 2nd run every time, but I am looking to skip some code that isn’t implemented yet as part of a re-write and the IDE skips everything except for a close. When it comes across a close in code that is supposed to be skipped, it is closing the browser.
Hi Dennis, glad to see someone who is facing the same issue (although this issue is not a happy issue).
Have you found a way to solve/work around to this issue ?
Not to date, have just taken the Close out and hope for the best.
${j}
will return a string and therefore ${j} + 1
is "1 + 1"
. Could you please try again with j + 1
(it works on my side)?
gotoLabel.html (7.0 KB)
[info] Playing test case Untitled Test Suite / Untitled Test Case
[info] Time: Tue Dec 25 2018 10:43:29 GMT+0700 (Indochina Time) Timestamp: 1545709409937
[info] OS: Windows Version: 10
[info] Browser: Chrome Version: 71.0
[info] If the test cannot start, please refresh the active browser tab
[info] Executing: | open | https://katalon-test.s3.amazonaws.com/demo-aut/dist/html/form.html | |
[info] Executing: | storeEval | 1 | j |
[info] Store '1' into 'j'
[info] Executing: | storeEval | 1 | k |
[info] Store '1' into 'k'
[info] Executing: | label | COMMENT | |
[info] Executing: | type | id=comment | ${j} |
[info] Expand variable '${j}' into '1'
[info] Executing: | storeEval | j+1 | j |
[info] Store '2' into 'j'
[info] Executing: | gotoIf | j<3 | COMMENT |
[info] Executing: | type | id=comment | ${j} |
[info] Expand variable '${j}' into '2'
[info] Executing: | storeEval | j+1 | j |
[info] Store '3' into 'j'
[info] Executing: | gotoIf | j<3 | COMMENT |
[info] Executing: | gotoLabel | END | |
[info] Executing: | type | id=comment | skipped |
[info] Executing: | storeEval | k+1 | k |
[info] Executing: | label | END | |
[info] Executing: | type | id=comment | end |
[info] Time: Tue Dec 25 2018 10:43:30 GMT+0700 (Indochina Time) Timestamp: 1545709410994
[info] Test case passed
1 Like
Hi devalex88, thanks for your comment. I tried your codes, in my case, j+1 turns out value of 11. while ${j}+1 results in 2. my Chrome extension is Katalon Recorder 3.6.11.
Additionally, I agree the codes works, but if you look at the log, you will find following commands were excuted, even though they don’t look to have any effect.
info] Executing: | type | id=comment | skipped |
[info] Executing: | storeEval | k+1 | k |
And if you run again, above two commands will not be executed any more and disappear in the log.
Although in this case, the two commands have no harm in first run, but I had some other scenarios which caused some problems. I could not recall them now - - || I would post some examples here if i hit it again.
In short, this log does not sound logical, right? The first & 2nd log should be showing the same thing rather than two. It should be either the first time run the commands but for some reason not have an effect OR the log is wrong.
Thank you for the response. Just to clarify - did you edit your code based on my screenshot or download my attachment (gotoLabel.html
)?
I edited my code based on the screenshot.
Then, please make sure j
and k
is initialized using storeEval
.
Ya, I did. Here is the screenshot of code and variable
Code
Variable
I’m sorry for not highlighting the changes.
Cool! it works as expected this time.
Could you please explain the difference between store & storeEval? Thanks!
I’m glad it helps. Basically, storeEval
executes target
s as JavaScript code, while store
see them as strings (with ${variable}
to be expanded into values). I’m sorry for missing that in the documentation
.
1 Like