AdamBenoit
15 years agoOccasional Contributor
Comparing the value of a hidden field
Hi all,
I am trying to compare the value of a hidden field with an expected value that is stored in a spreadsheet that is used as part of a data driven loop.
The example I found in the "TestComplete 8 Made Easier" book is for a text field and does not seem to work as I expected on a hidden field.
The field looks like:
<input type=hidden name=cartPackage value="AR">
I set the "Call Object Method" in my keyword test to:
Sys.Process("iexplore").Page("*").NativeWebObject.Find("name", "*cartPackage*", "input")
Then select "Find", But what is supposed to be in the fields labelled "PropNames" and "PropValues"?
I set PropNames to "cartPackage" and PropValues to "Project.Variables.TestMatrix("Package")" which is where the expected value is stored.
I then use a If...Then block set to "Last Operation Result" Does Not Equal "False"
The documentation says: "If no object matching the search criteria was found, the
property equal to False. So, you can check the
So how do I see what is in the "Exists" property in a keyword test?
Please let me know if I'm on the right path and possibly what I'm missing.
I am trying to compare the value of a hidden field with an expected value that is stored in a spreadsheet that is used as part of a data driven loop.
The example I found in the "TestComplete 8 Made Easier" book is for a text field and does not seem to work as I expected on a hidden field.
The field looks like:
<input type=hidden name=cartPackage value="AR">
I set the "Call Object Method" in my keyword test to:
Sys.Process("iexplore").Page("*").NativeWebObject.Find("name", "*cartPackage*", "input")
Then select "Find", But what is supposed to be in the fields labelled "PropNames" and "PropValues"?
I set PropNames to "cartPackage" and PropValues to "Project.Variables.TestMatrix("Package")" which is where the expected value is stored.
I then use a If...Then block set to "Last Operation Result" Does Not Equal "False"
The documentation says: "If no object matching the search criteria was found, the
Find
method returns a stub object that only contains the Exists
property equal to False. So, you can check the
Exists
property value of the returned object to determine whether the search was successful."So how do I see what is in the "Exists" property in a keyword test?
Please let me know if I'm on the right path and possibly what I'm missing.