In UFT API testing how can I create a checkpoint to make sure the response does not contain a certain string?
Question ID: 106577
1
0

I want to make a checkpoint that is basically "does not contain". The UFT-API interface for checkpoints only lets me do "contains". Is there a simple way to accomplish this?

Marked as spam
Posted by (Questions: 36, Answers: 3)
Asked on January 8, 2016 8:58 pm
130 views
Answers (1)
0
Private answer

![alt text][1]**My example 1:**

Let's suppose in the response is the string ''Frankfurt''.
We want to verify that the response 'does not contain' the string ''bob''

create a checkpoint on the field with Expected value like the following:
Regex ^((?!bob).)*$

This checkpoint will PASS if the response is ''Frankfurt'' because we are checking to make sure the response does not contain ''bob''

**My example 2:**

Let's suppose in the response is the string ''Frankfurt''.
We want to verify that the response 'does not contain' the string ''ank''

create a checkpoint on the field with Expected value like the following:
Regex ^((?!ank).)*$

This checkpoint will FAIL if the response is ''Frankfurt'' because we are checking to make sure the response does not contain ''ank'', but of course it does contain ''ank''.

Confusing enough?

[1]: /storage/temp/386-2016-01-08-1611.png

Marked as spam
Posted by (Questions: 6, Answers: 167)
Answered on January 8, 2016 9:09 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top