This site requires JavaScript to be enabled
IE BUMPER

Logo

Dear Tricentis qTest users,

If you would like to submit a Tricentis qTest ticket,

please use this support request form.

Tosca Version
IncidentLookup using list
Language
How can we help?

Solution Suggestions

Please enter your question to get suggestions.
  Help
IE BUMPER
Categories
Boolean Operators
OR or vertical bar symbol (|)
Finds a match if either the terms exist in a document (a union using sets).
AND
Finds a match if both terms exist in a document (an intersection of sets).
NOT, minus (-), or exclamation point (!)
Excludes documents that contain the term after NOT (a difference of sets).
Wildcards
Asterisk (*)
The asterisk symbol performs a multi character wildcard search.
Percent sign (%)
The percent sign performs a single character wildcard search.
Phrases
Quotation marks (")
Use quotation marks to search for an exact phrase with multiple terms.
For examples and more information look at our Knowledge Base: Advanced Search On The Support Portal

Verify only desired objects are loaded in an Array (Tosca 11.0)

hi,

i used the search function to find out if there's a topic about this already, but i couldn't find one. If there's one -> please point me to it.

I'm starting to use the new API Engine for backend tests in Tosca 11.0 (used the old webservice engine a while now) and i'm having trouble finding a way to make sure, certain data is not loaded in a response.

e.g. an insurance customer loads the list of all this contracts. he's also able to filter the search using search parameters like - let's say - "category" or "contractNumber". If i use a search parameter i want to make sure, in a Test Case, only the desired results are loaded and nothing else.

So, how can i do that using the API Engine in Tosca 11.0?
• The response deliveres an array of contracts
• I can verify the desired data is shown using ActionMode Constraint and verify e.g. a contract number.

How to i verify a certain contract is not loaded?
• Constraint doesn't work, because the data to look for is not there. of course.
• I could count the number of returned contracts - but how? (in the webservice engine i used a count on the root array).

Please help - i really want to find a solution and i'm hoping i just don't see the obvious way to do it ;)
cheers,
Paul

1 0

Andreas Windbichler

Created: 2019-03-28 06:27:36

Unfortunately there is no smooth way at the moment to achieve this with the API Engine. 

- Constraining on a non-existing node fails. It might however be possible that this functionality would be introduced in future versions

- The second option would be, as you say, verifying that the ResultCount for this element is 0. Again however, there are limitations in combining ResultCount with Constraint. So this use case will probably (no guarantees) be possible starting with Tosca 12.2 (which is the upcoming release).

- So for now, what you could do, is to save the response to a XML or JSON file, and then use our XML or JSON Engine to perform this verification.

Hope this helps

BR, Andreas

0 0

Axel Behrens

Created: 2019-03-28 08:19:37

Hi Paul,
in this case I would use the ApiEngine response module to verify the StatusCode only and for the content / body use normal JSON or XML modules with the resource LastResponseResource which is created automatically when using the ApiEngine, cf. https://support.tricentis.com/community/article.do?number=KB0013338.

Cheers,
Axel

0 0

Paul Sailer

Created: 2019-03-28 08:40:23

Hi Andreas,
thank you for the answer. That's really unfortunate.
It is not possible to just count the number or items in an array? I wouldn't need a constraint. I just want to count how much items/objects are returned.

Could you please point me to a detailed Howto on how to verify using the Json Engine? I didn't use it before and if there's no way around it would be helpful to get a detailed description.

@Axel. Thanks. I'm afraid i'd need more detail.
- where do i find these two modules?
- so these modules buffer e.g. that last response. And i verify against what i expect that (whole) response to look like. correct? 

Thanks for your help:)

Andreas Windbichler

2019-03-29 08:27:25

If you do not need to constrain and just want the number of objects, it should be fine using ResultCount. Because it is possible to count, just not in Combination with constraint.

Check this example screenshot:

 

BR Andi

0 0

Paul Sailer

Created: 2019-08-05 13:25:01

@Andreas

I now have Tosca 12.1 and i still didn't figure out how to do this properly. 
So: I delete an item and i want to make sure afterwards it's not returned in an array.

what's your take on this? How would you do it?
Example:
I deleted a bank account that would look like this:

    {
        "classId": "BankAccount",
        "self": "V2F21F8E977EC7009CB8DF2BA7C375751A2ADDDB9EED4F84C4DC3BE9B8B05FAE4D27FC9C023FDBC88B4FFFE6490726D75A",
        "owner": "V2BFA7A69D6DFBFC89045FA3D7CF6624923E655A5E418D3C801F1D9D4ADC6DDBEAA2DA5C863EAA8E31778B1997C9EC6C39",
        "iban": "AT753626300000504225",
        "swiftcode": "RZTIAT22263",
        "sepaMandates": []
    },

now it's not returned - other items are.
is there a possibiliy to do that? 
verify IBAN AT753626300000504225 is not found among the returned items.

0 0

Paul Sailer

Created: 2019-08-06 08:50:25

fyi, 
i opened a new topic for the Tosca 12.1 issue: https://support.tricentis.com/community/article.do?number=KB0014862

IE BUMPER

Tosca is the perfect solution

Optimize - Manage - Automate

Download Trial