This site requires JavaScript to be enabled
IE BUMPER

Tosca Version
IncidentLookup using list
Language
How can we help?

Solution Suggestions

Please enter your question to get suggestions.
  Help
IE BUMPER
Product
Results per page
Tosca Version
Categories
Version
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

First element in array

Hello,

I get the following Json document with an array as a response to a rest call:

[{
    "id": "ABC",
    "name": "Dummy Person",
    "Number": "123",
    "Starting": false,
},
{
    "id": "ABC",
    "name": "Dummy Person",
    "Number": "234",
    "Starting": true,
},
{
    "id": "ABC",
    "name": "Dummy Person",
    "Number": "345",
    "Starting": true,
}]

How do I get the Value of "Number" of the first Element of this array where "Starting= true" when "id" and "name" are the same for all three Elements? 

I have the Module created but when i want to constrain on "Starting = True" I get "more than one control found"

 

I am using Tosca 11.0

Thanks for any advice!

1 0

Andreas Windbichler

Created: 2018-11-14 16:07:48

Hi Arnold,

you can use the Index keyword for that as described here. Take a look at the example, which is basically the same as your JSON:

https://support.tricentis.com/community/manuals_detail.do?lang=en&version=11.0.0&url=engines_3.0/api/api_tc_lists.htm

BR Andreas

Arnold Huber

2018-11-15 14:51:33

Thank you!

Out of Curiousity: Is this possible with the webservice-engine? I have some old Testcases and it would take some time to rebuild them in the api engine.

1 0

Andreas Windbichler

Created: 2018-11-16 08:32:16

Please find attached an example subset (using your JSON from above), where I show how to do it with Webservice engine.

Key points:

  • module attribute "item" was made generic (property "Name" got a wildcard; property "cardinality" set to 0-n to allow multiples)
  • Parameter "ExplicitName" was added to "item". This allows to specify #1 in the TestCase in place of the name of the element, making it steerable by index

Hope it helps! KR Andreas 

Attachments

Arnold Huber

2018-11-16 09:53:44

Works perfekt.

Thank you very much!

IE BUMPER

Tosca is the perfect solution

Optimize - Manage - Automate

Download Trial