Forum Discussion

AdamBenoit's avatar
AdamBenoit
Occasional Contributor
15 years ago

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 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.
  • Hi,



    'PropNames' is the name of the property by which you want to find your object. In your case, it is "name". 'PropValues' is the expected value of this property ("cartPackage").



    As for checking the Exists property in a KD test, you can find an example in the "Waiting for a Process or Window Activation" help topic.