I know exactly what I want to achieve but am not sure if Test Complete will allow this.
I have a file containing credit card types and numbers, and want to check the web service that returns a value stating if the card type & number are valid or invalid.
I have created an XML checkpoint (CCValidate1) for the VALID response and need to create another for the Invalid response (CCValidate2).
The idea I had was to store the checkpoint name in the Excel file against each row, so if the expected response is Valid, call XML checkpoint CCValidate1, and if invalid, call CCValidate2.
The code I have to start with when I pass in the values is:
If (Not XML.CCValidate1.Compare(WebServices.CCValidate))
What I want to do is use a variable in place of the hardcoded 'CCValidate1' above in the If statement.
If (Not XML. <font color="red">Variable </font> .Compare(WebServices.CCValidate))
That way I am passing in the correct XML checkpoint for each test.
How do I do this?
Any help is much appreciated,
You can use the Eval function to achieve this. Please visit the following page for more information:
The relevant line can look like this:
<font class="small">Code:</font><hr /><pre>' VBScript
If (Not Eval("XML." & Variable & ".Compare(WebServices.CCValidate)"))
Allen - SmartBear Support
Thats great - it now works just as I had hoped.