This is a migrated thread and some comments may be shown as answers.

Else part of if/else failing

6 Answers 163 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Uroš
Top achievements
Rank 2
Uroš asked on 19 Feb 2016, 12:32 PM

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!

6 Answers, 1 is accepted

Sort by
0
Ian
Top achievements
Rank 1
answered on 19 Feb 2016, 01:39 PM

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
 

0
Uroš
Top achievements
Rank 2
answered on 22 Feb 2016, 08:01 AM
The problem in my case is that ELSE part always fails...I have included scenario in att.
0
Ian
Top achievements
Rank 1
answered on 22 Feb 2016, 09:29 AM

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

0
Ivaylo
Telerik team
answered on 24 Feb 2016, 08:23 AM
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!
0
Uroš
Top achievements
Rank 2
answered on 24 Feb 2016, 08:37 AM

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...

0
Ivaylo
Telerik team
answered on 24 Feb 2016, 12:21 PM
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!
Tags
General Discussions
Asked by
Uroš
Top achievements
Rank 2
Answers by
Ian
Top achievements
Rank 1
Uroš
Top achievements
Rank 2
Ivaylo
Telerik team
Share this question
or