Forum Discussion
Hi,
Can you show how your text fields are presented 1) on the web page and 2) in the Object Browser?
- hhagay9 years agoContributor
Good morning baxatob
I have attached a word document comprises of the fields you requested.
Let me know if you need additional information.
Thanks
- tristaanogre9 years agoEsteemed Contributor
What happens if you do a recording of entering data in the SSN fields? How does TestComplete map them? TestComplete is pretty "smart" when it comes to such stuff so, rather than attempting to code around it, try a record and see what it comes up with.
As it is, there is a class with class name "field field--grouped" and there is a label asociated with it for "ssn_mask". That MIGHT be able to be mapped using those properties. Then, you have three child objects underneath ordered from left to right by reactid. That MIGHT be how you need to access those fields... start with the parent ssn_mask object and then map the three objects underneath, perhaps using wildcards for the reactID's like *.0, *.1, and *.2 to distinguish them.
- hhagay9 years agoContributor
Hello Robert
I tried recording but it didn't help. Here is the record code.
function Test1() { var panel; var textbox; Browsers.Item(btChrome).Navigate("https://qa1-payrollplussuite.castandcrew.com/offers/4508/onboarding/profile"); panel = Aliases.browser.pageQa1PayrollplussuiteCastandcr.form.panel.panel.panel.panel.panel; textbox = panel.panel.panel.textboxSocialSecurity; textbox.Click(23, 16); textbox.SetText(""); textbox.Click(12, 19); textbox.SetText("45"); textbox.Click(13, 16); textbox.SetText("6789"); textbox = panel.textboxAlternateEmployeeId; textbox.Click(36, 12); textbox.SetText("1234"); }
I try to stay away from TC name mapping or anything that will limit the code (as much as possible). I use XPat throughout.
The SSN input boxes are designed in such way that as soon as user enters 3 digits in box 1, it shifts focus to box 2. As soon as user enters 2 digits here, it transfers focus to box 3.
I came up with this unintelligent code.
var btnSSN1 = page.FindChildByXPath("//input[1][@id='ssn_mask']"); var btnSSN2 = page.FindChildByXPath("//input[2][@id='ssn_mask']"); var btnSSN3 = page.FindChildByXPath("//input[3][@id='ssn_mask']"); btnSSN1.SetText(strOne); Delay(500); btnSSN2.SetText(strTwo); Delay(500); btnSSN3.SetText(strThree); Delay(500);
But that (semi) solved the SSN issue only. I have all kinds of challenges in this form ( and I have 4 of them.. :) )
For example; I am still baffled why I cannot click a dropdown list box and select an item via automation. I will not stay open for the script to select the option.
Related Content
- 3 years ago
- 10 months ago
- 8 years ago
Recent Discussions
- 2 days ago