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

Negative Verification

3 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Waylon
Top achievements
Rank 1
Waylon asked on 16 May 2011, 06:38 PM
Hi There,

Currently I'm using TestStudio_2011_1_502_Purchease. Here some questions need confirm.
1. How to do the negative verification. We are using Telerik testing a website, in the website there has images, we need to verify the images are loaded or not, currently I am using If Else, seems that works, any good solution?

2. How to handle the image verification if the screen resolution changed or change to another machine? Seems the image verification failed if screen resolution changed.

3. How to parametrize steps? Some steps I want to reuse and don't want to record all steps, could I just change the parameter?
For instance:  Step1: Pages.x2011AppleViewFull.Click(false)
                       Step2: Pages.x2011OrangeViewFull.Click(false)
you can see there almost same just x2011AppleViewFull and x2011OrangeViewFull are different, could I use Pages.(object).Click(false)?

I hope can get response quickly, because those impact our work now

Thanks
Waylon

3 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 17 May 2011, 10:13 PM
One approach is to navigate the test to a point where the object is present and then perform a verification against it.  Stop the test and change the verification from something like "exists" to "does not exist", and design your steps accordingly so the condition that would make the object NOT visible is satisfied before the verification step executes. 

You can also copy steps from one test to another, so if you have a verification point in another test that ensure that the object exists, copy the step and then paste it into your new test, then change the verification to ensure that the object does NOT exist.  I'm not great at explaining these kinds of things, but I hope this helps.
0
Waylon
Top achievements
Rank 1
answered on 18 May 2011, 04:37 PM
How about arametrize steps? Some steps I want to reuse and don't want to record all steps, could I just change the parameter?
For instance:  Step1: Pages.x2011AppleViewFull.Click(false)
                       Step2: Pages.x2011OrangeViewFull.Click(false)
you can see there almost same just x2011AppleViewFull and x2011OrangeViewFull are different, could I use Pages.(object).Click(false)?
0
Stoich
Telerik team
answered on 20 May 2011, 09:46 AM
Hi Waylon,
       even though the steps seem quite similar they actually refer to two completely different elements. Test Studio sees
Pages.x2011AppleViewFull
Pages.x2011OrangeViewFull

as separate elements each with its own Find Logic. So you'll need to parametrize the Find Logic for these steps. We currently don't have such a feature (we've had some requests for it though). It can be done in code but if your only motivation is to save time and effort it won't do you much good.

On the image verification: are you referring to the browser zoom level? You can set the tolerance level to higher numbers in order to get the Verifications to pass under different resolutions (screenshot 1). A tolerance level of about 50% will allow the Verification to pass for almost all possible browser resolutions. Keep in mind that resolutions different from 100% can also cause failures in other types of test steps. For instance Silverlight test will always fail under non-100% browsers.

Best wishes,
Stoich
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Waylon
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Waylon
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or