Else part of if/else failing

7 posts, 0 answers
  1. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 19 Feb Link to this post

    I have created if/else condition, if part is working OK, but else if failing. I have attached execution log...

     

    '19.2.2016 13:27:18' - 'Pass' : 1. Navigate to : '/'
    '19.2.2016 13:27:18' - 'NotRun' : 2. Wait for 'TextContent' 'Contains' 'Sign in to start your session' on 'SignInToPTag'
    '19.2.2016 13:27:33' - 'Fail' : 3. IF (Wait for 'TextContent' 'Contains' 'Sign in to start your session' on 'SignInToPTag')
    '19.2.2016 13:27:33' - Unable to determine logical branch to go into. Unable to execute verification.
    ------------------------------------------------------------
    Failure Information: 
    ~~~~~~~~~~~~~~~
    Unable to locate element. Details: Attempting to find [Html] element using 
    Find logic 
     (Html): [tagname 'Exact' p] AND [TextContent 'Exact' Sign in to start your session]

    Unable to locate element. Search failed!

  2. Ian
    Ian avatar
    5 posts
    Member since:
    Feb 2016

    Posted 19 Feb in reply to Uroš Link to this post

    Hi Uros,

    Looking at your steps, i believe If the "IF" statement is working, im assuming the "ELSE" statement will only run when you are already logged in, which would mean that [TextContent 'Exact' Sign in to start your session] would not be found.

    I hope that it helps, and made sense :)

    Regards

    Ian
     

  3. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 22 Feb Link to this post

    The problem in my case is that ELSE part always fails...I have included scenario in att.
  4. Ian
    Ian avatar
    5 posts
    Member since:
    Feb 2016

    Posted 22 Feb in reply to Uroš Link to this post

    Hi Uros,

    The problem is, when the ELSE statement is to be run, you are basing it on "TextContent contains" on a element that is not there ('SignInToPTag').

    if you change the verification statement for the element 'SignInToPTag' to "Wait for exists".

    When the IF statement cant be run, the ELSE will run.

    Regards

    Ian

  5. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 24 Feb Link to this post

    Hello Uros,

    I guess what Ian says is making sense, did you manage to solve the problem?

    @Ian Thank you for helping in public forums, I have updated your telerik points accordingly.

    Regards,
    Ivaylo
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  6. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 24 Feb Link to this post

    Yes, the suggested tip solved the problem. Thx Ian.

    I have followed the example in documentation (http://docs.telerik.com/teststudio/features/logical-steps/if-else) and end up in this situation...

  7. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 24 Feb Link to this post

    Hello Uros,

    Glad to hear it is working. We will address this in our documentation.

    Regards,
    Ivaylo
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top