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

If Then Else

13 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 28 Mar 2011, 08:53 PM
Does the ELSE need to used?
In the IF part, does the verify that gets attached to the IF need to be set as wait Verify?
Can you change the verify to Wait Verify after it is pulled in to the IF?

I keep getting triangles on the IF THEN step, why?
I do not have any of the steps set to continue on fail.
The test runs through to the end and I get triangles on all steps, why?
Everything looks good during execution.

It seem to me in general that any test can have only so many triangles.
Once it hit a certain amount of triangles, the whole thing is triangles.

13 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 28 Mar 2011, 11:47 PM
Hello Sebastian,

Thank you for your question on If/Else statements. Yes, the Else step must be used and cannot be removed. The program must know what do to if the If statement is not met.

No, the attached verification to the If section does not need to be a Wait Verify; it can be a standard Verify. You cannot change a Verification to Wait after it is pulled into the If section, you must do that beforehand.

The yellow triangles containing exclamation marks simply signify that the step(s) did not execute. If the "If" verification is met, then the "Else" step and its action will not execute and will be marked with triangles. The opposite is true for the "If" step is its verification is not met and the "Else" step is executed instead. This does not mean an error occurred, just that the step(s) was skipped based on the logical statements.

All the best,
Anthony
the Telerik team
0
Sebastian
Top achievements
Rank 1
answered on 29 Mar 2011, 11:35 AM

I'm using a verify checked value is false for the IF
I'm using a check control place holder for the THEN
and I've tried using comment, text verify and click on a blank area for the ELSE
I don't need the ELSE,
I just want Web UI to verify the box is checked or not and check it if it is not checked
I'm just putting anything in the ELSE so I don't get a triangle
No matter what I get a triangle
Where am I going wrong?


Here is a pic of my steps
0
Anthony
Telerik team
answered on 30 Mar 2011, 12:04 AM
Hello Sebastian,

Your IF ELSE if structured just fine. Actually though looking over the screenshot you sent, I think you can safely eliminate the IF ELSE block totally. The reason is that a "Check" test step will literally force the checkbox to a specific state (checked or unchecked). This means no matter what the state of your checkbox before that test step, it will be checked (or unchecked if you prefer) after the "Check" test step.

I am more worried about all the triangles showing up. This is not normal. When you try to execute your test, does the browser window open? Do any of the test steps run? When the test is done what does the test log contain? I strongly suspect something else is going wrong that has nothing to do with your IF ELSE block.

All the best,
Anthony
the Telerik team
0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 11:59 AM
If I leave only the steps before the IF THEN ELSE, I get all green.
I tried turning just one of the IF THEN ELSE on an I got all triangles.

Here is the log

------------------------------------------------------------
'3/30/2011 6:52:09 AM' - Error encountered during execution.
------------------------------------------------------------
'3/30/2011 6:52:09 AM' - Error inside the callback listener. Error: System.Runtime.Serialization.SerializationException: AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only. ---> System.IO.FileLoadException: AssemblyResolveEvent handlers cannot return Assemblies loaded for reflection only.
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.DelegateSerializationHolder.GetDelegate(DelegateEntry de, Int32 index)
   --- End of inner exception stack trace ---
   at System.DelegateSerializationHolder.GetDelegate(DelegateEntry de, Int32 index)
   at System.DelegateSerializationHolder.GetRealObject(StreamingContext context)
   at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
   at System.Runtime.Serialization.ObjectManager.DoFixups()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at ArtOfTest.WebAii.Messaging.Process.PipeCommand.FromBinary[T](Byte[] bytes)
   at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.ReadCommandFromPipe[T](PipeStream pipe)
   at ArtOfTest.WebAii.Design.Execution.RunnerController.CallBackListener()
------------------------------------------------------------
'3/30/2011 6:52:09 AM' - Aborting....

 

I'm just trying to get the IF THEN ELSE to look at a check box and see if it is checked.
If it is not checked then check it.
It seems simply but it doesn't work.
When I watch the screen I see it check the box when it is empty.

0
Stoich
Telerik team
answered on 30 Mar 2011, 12:10 PM
Hello Sebastian,  
      this sounds like a know problem that's already logged as a bug.

Here's the workaround:
Go to where Test Studio is installed (example for default 64bit OS):
C:\Program Files (x86)\Telerik\WebUI Test Studio 2010.3\Bin\
and edit the config file ArtOfTest.Runner.exe.config to exclude the .Net Framework4 runtime - it should look like the example bellow:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <!-- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> -->
    <supportedRuntime version="v2.0.50727" sku=".NETFramework,Version=v3.5" />
  </startup>
</configuration>


Once you've saved this you shouldn't get this error anymore, let me know.

All the best,
Stoich
the Telerik team
0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 12:40 PM
This is working better.
It seems what ever part of the IF THEN ELSE that is not used has a triangle on it.
That is just like any other unchecked step.
I'll go back and turn on the rest of my steps and run the test and see how it goes.
Thanks

0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 01:53 PM
One thing that would be nice-

I can drop open the ELSE and see the step.
I can see the THEN as well.
But I can not see the IF in a drop down and edit it or pull it out and drop one in its place.
Say I want to change a verify to a Wait on verify.
I can't without a lot more work.
Or if I just wanted to add more Wait time to the IF.
Thanks
0
Anthony
Telerik team
answered on 30 Mar 2011, 04:37 PM
Hello Sebastian,

Once a Wait or Verification is attached to an IF statement, you can overwrite it by adding a second Wait or Verification to replace the first. 

You can easily edit that Wait or Verification attached to the IF statement. Simply double click the IF step and four common properties will be visible and editable. This includes WaitOnElementsTimeout. There are several more options available under the Verification heading in the Properties in the upper right window. Lastly, you can right click the IF step and choose Edit Verification.

You are correct in that a Verification cannot have its role changed once attached to an IF statement. I will investigate logging this as a feature request.

Regards,
Anthony
the Telerik team
0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 04:59 PM
I found one other bug.
When you add an IF THEN ELSE step the drag and drop gets disabled
Then you need to close Web UI and restart it to get it back on again in Web UI
I cannot drop a step in to the THEN unless I restart Web UI
I'm using version 2010.3.1213.0
This may not be a problem in new revisions
0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 07:28 PM
Okay, more problems
I added the IF THEN ELSE steps to five test.
They run 100% in the record tab.
When run from a Test List, every step is a triangle.
What happened???
Also, what is the max time that can be set on a Wait?
I've tried 60 sec and I can tell it is not waiting 60 sec.
0
Anthony
Telerik team
answered on 30 Mar 2011, 07:54 PM
Hello Sebastian,

I am on Product Version: 2010.3.1502.0 and my drag and drop works great. This includes in and out of logical operators. I suspect if you upgrade your issue will be resolved.

Best wishes,
Anthony
the Telerik team
0
Sebastian
Top achievements
Rank 1
answered on 30 Mar 2011, 08:17 PM
What is the max time that can be set on a Wait?
I've tried 60 sec and I can tell it is not waiting 60 sec.
0
Anthony
Telerik team
answered on 30 Mar 2011, 10:30 PM
Hello Sebastian,

The maximum Wait time is very large; it equals the max value of a 32 bit integer (this is over 2 billion).

Our program uses milliseconds, however. So to set the wait to 60 seconds, enter 60000. If that value is corrected and you still see errors, please submit the test log when it fails so we can troubleshoot.

Thanks,
Anthony
the Telerik team
Tags
General Discussions
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Sebastian
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or