Skip to main content
Navigator | Tier 3
March 23, 2022
Question

If validation issue

  • March 23, 2022
  • 9 replies
  • 158 views

Hi,

Am I missing something obvious, or is it a bug?

 

I create logic.

If at line 10 is checking if the object exists, if not, it should go to the next stage - if: Else if (I previously used Else, but it doesn't work as well))

but it does not go to the next stage. Instead of moving to the next validation stage is, throwing an error that object does not exist, which is correct. That is why I used if logic here.

Do you have any advice?

image

    9 replies

    Tamil Arasu10
    Most Valuable Pathfinder
    Most Valuable Pathfinder
    March 23, 2022

    Hi @Robert Ozog​ ,

     

    Please double check both windows titles and check whether the application is reacting slowly? Please add a few seconds delay before the validation and give it try.

     

     

    Thanks!

     

    _Tamil_
    MrOzogAuthor
    Navigator | Tier 3
    March 23, 2022

    Hi,

    Names are correct, adding delays n do not fix anything.

     

    The main issue I have is:

    Why is IF stage is throwing an error?

    It should go to line 21 - that is the basic logic of its statement.

    Cadet | Tier 2
    March 24, 2022

    Hi @Robert Ozog​ 

    Looking at the line 21. settings, bot tries to find object in $window-4$ "Validation Complete" that doesn't sound right.

     

    I'd use: IF window exists (title "Validation Unsuccessful")

    or even safer: IF window with same title exists "Validation Unsuccessful"

     

    When it comes to action, you can either record OK button within this window (not the "Validation Complete" one) or simply send keystroke (again, to "Validation Unsuccessful" window).

    MrOzogAuthor
    Navigator | Tier 3
    March 24, 2022

    Hi,

    Thank you for your reply.

    Line 21 is irrelevant. When I disable the whole IF Else statement the bot behave this same.

    Instead of your solution (thank you for that), I'll use Try - Catch to solve that issue.

    However, it looks like I found a serious bug in AA software.

    Tamil Arasu10
    Most Valuable Pathfinder
    Most Valuable Pathfinder
    March 24, 2022

    Please change the package version and give it try

    _Tamil_
    MrOzogAuthor
    Navigator | Tier 3
    March 24, 2022

    Mystery solved :)

    I used condition - check if object exists.

    What I should do is use the condition - check if WIndow exists.

    When I change that all starts working perfectly :)

    Thank you very much for all your answers and comments!

    MrOzogAuthor
    Navigator | Tier 3
    March 24, 2022

    Hi,

    I change the package, the error is still throwing.

    I just realised that in other parts of my code whenever I'm using IF statement for checking if object exists it's throwing an error :(

    Cadet | Tier 2
    March 24, 2022

    Hey @Robert Ozog​ 

    No worries, to check if object exists in $window-4$, there must be opened $window-4$.

    Error returned says basically that bot couldn't check if object exists in that window because there is no such window.

    You might still want to base your IF conditions on whether window with title "Validation complete" or "Validation Unsuccessful" exists or not, only then you'll be able to click.

    Tamil Arasu10
    Most Valuable Pathfinder
    Most Valuable Pathfinder
    March 24, 2022

    Nice @Robert Ozog​ 😃

    _Tamil_