ServiceTest 11 (ST) complex data type checkpoint

  • Questions
  • ServiceTest 11 (ST) complex data type checkpoint
Question ID: 104378

In a Checkpoint, is there a way to map the expected result of a complex data type (one where n number of values can be returned) to a Data source (excel, database, xml)? It appears that only Available steps and Test variables are the only options available in the Select Link Source window.

For example, depending on the data at the time of test, a variable number of books can be returned:

  <title>Now You See Her</title>  
  <author>James Patterson</author>  
  <title>The Thank You Economy</title>  
  <author>Gary Vaynerchuk</author>  

Marked as spam
Posted by (Questions: 3, Answers: 4)
Asked on June 30, 2011 4:15 pm
Answers (1)
Private answer

I structured the test in the following way, which is different than how I was trying to structure it...
[Script Flow][1]

What you do not see in the Test Flow is that I created a database data source. So the expected results (data in the database) is queried at runtime.

In the Property Sheet of the Test Flow, the Input, select 'For Each' Loop option. Then in the Loop for each item in: field, select link to source. The Data source column option should be selected, then expand the tree and select the data source name.
[Flow Loop][2]

To extract the first element from the web service response, I store it in a variable first to make it easier to use it in later steps. But the trick to make it iterate through response is join the output tag with the current iteration of the for loop in the Test Flow.
[Response Tag][3]

Now add a condition statement to compare the DB value to the WS value. Since the Flow Loop is driven by the DB data source, the variable for the conditional statement should use the db as well. The Value is linked to the variable created from the web service response. [Condition][4]

The result is a script that will handle a variable number of records in the database and a variable number of values from the web service. The example in the solution here is only for one value in the response. But it could be easily expand to handle the example posted in the original question

[1]: ''ST Flow''

Marked as spam
Posted by (Questions: 3, Answers: 4)
Answered on July 5, 2011 6:38 pm
( at July 14, 2011 8:26 am)