Ask a Question

TypeError : textBox.Click is not a function

KumaranRavi
New Contributor

TypeError : textBox.Click is not a function

nameField = dynamicDataDisplayControl.IDataDisplayField0;
textBox = nameField.firstName;
textBox.Click();
textBox.SetText("Abel1");
textBox = nameField.lastName;
textBox.Click();    /// Got Error while executing the script at this point
textBox.SetText("Felix1");

5 REPLIES 5
Marsha_R
Community Hero

If you move the last name section above the first name section, does it still fail? 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
KumaranRavi
New Contributor

It doesn't work. Actually the generated script was textbox.Click(14, 6) and textbox.Click(20, 9). I have removed the numbers and rerun the script. It did not work.

Well no, it wouldn't work that way because now there's nowhere for the Click to happen. You have to have coordinates or an object name.

 

If you use Object Spy on the last name field, what does it show you?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
KumaranRavi
New Contributor

WinFormsObject("EditVictimWizardDlg").WinFormsObject("propertyPagePanel").WinFormsObject("pagePanel").WinFormsObject("DynamicDataDisplayWizardPage").WinFormsObject("VictimMainView").WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel", "").WinFormsObject("centerPanel").WinFormsObject("IDataDisplayField0").WinFormsObject("lastName")

 

If the Script is generated with random click/coordinates, can we use the same Coordinates every time with the new build as well.

Best practice is to use the object name because generally that doesn't change. The coordinates are much more fragile and can break the test more frequently.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: