Forum Discussion
Can one parameterize that piece which refers to the specific text field? Simple answer is yes.
But how ..depends on how your approch to designing tests.
- if you use name mapping you may map up to the object "grpPatternID" and give single name something like "PatternID" then you can call Aliases.PatternID.GemCat.txtPatterName and Aliases.GemCat.PatternID.txtSAPInvestigationDescription
- if you may like to have very simple mapping structure like me ..., would map only higher object such as maping object "frmPatternMetaData" and find from there like Aliases.PatternID.PatternMetaData.findChild(".....","PatterName",10,true)
- if you are not like name mapping can use Sys.Process("GemCat_Gui").findChild(".....","PatterName",10,true)
- Or you can just use variables var PatternID = Sys.Process("GemCat_Gui").WinFormsObject("frmPatternMetaData").WinFormsObject("grpPatternID") can call PatternID.WinFormsObject("txtPatterName") and PatternID.inFormsObject("txtSAPInvestigationDescription")
- mcastellanos9 years agoOccasional Contributor
Thank you for your response.
It is not clear to me how one would go about doing something as below:
Aliases.PatternID.GemCat.txtPatterName and
Aliases.GemCat.PatternID.txtSAPInvestigationDescription
Please note that I still have to hard-code for each text field. What if I want to do the following:
param1 = "txtPatterName"
Aliases.PatternID.GemCat.param1 (this is what doesn't work in TC. How would you do something like that?) or approaches 2, 3, and 4 are more conducive for something like that. I would like to concatenate the base string (green text) which stays the same and only pass the text field name (blue text).- NisHera9 years agoValued Contributor
probably after concatinate TC would it identified as just a string
but TC need objects to work with. eval() function gets object out of string
try something like..........(in jscript)
param1 = "txtPatterName"
objStr = "Aliases.PatternID.GemCat."+param1
eval(objStr )
- mcastellanos9 years agoOccasional Contributor
How would one do it using vbscript? I don't think there is such Eval() function. Thanks!
Related Content
Recent Discussions
- 15 minutes ago
- 3 hours ago
- 3 days ago