-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to put check condition inside for loop, gives error (PR fix committed) #423
Comments
Hi Shweta, do you have a website with the minimum replication steps, and the error message you get? |
Hi Ken, You can reproduce using any website. Its just that when you paste the check outside the for loop, it works.
} |
aisingapore#423 update summary - check step was not originally designed to work in for loops. this update allows check step to work in for loops, and also adds test cases to verify that check step can work within for loops. technical details - check step will insert an if block into the code block that immediately closes without normal processing line by line. this will cause TagUI to be mistaken that parsing is still within an if block and not handling a for loop block as it should be handled. in this change, a helper function check_intent_clear_injected_if_block() is added and called during parsing of check step to update TagUI internal tracking that the if block has been closed at end of the check step. that allows for loops to function correctly when check step is used within a loop.
#423 - enable check step within for loop **update summary** - check step was not originally designed to work in for loops. this update allows check step to work in for loops, and also adds test cases to verify that check step can work within for loops. **technical details** - check step will insert an if block into the code block that immediately closes without normal processing line by line. this will cause TagUI to be mistaken that parsing is still within an if block and not handling a for loop block as it should be handled. in this change, a helper function check_intent_clear_injected_if_block() is added and called during parsing of check step to update TagUI internal tracking that the if block has been closed at end of the check step. that allows for loops to function correctly when check step is used within a loop.
Good catch Shweta, thanks! Created PR and committed to master with following comments -
Prior to a future packaged release, this update is available from TagUI cutting edge version here - |
Thank you so much Ken for the quick fix. It works |
allValues="
changeStatusTo
"js begin
tempArr=allValues.split("/");
noOfStatus=tempArr.length;
console.log(noOfStatus);
js finish
for n from 0 to noOfStatus-1
{
status=tempArr[n]
if tempArr[n] equals to "abc"
{
//do some actions
check present('//div[contains(@Class,"forcePageError")]') | "Error Message is displayed" | "Error Message is not displayed"
}
The text was updated successfully, but these errors were encountered: