Ask a Question

TC-7 cannot recognize DIFFERENT InputBoxes (when more than 1 InputBox in Dialog)

Beginner_O
New Contributor

TC-7 cannot recognize DIFFERENT InputBoxes (when more than 1 InputBox in Dialog)

Hello,


I test the BETA-version of Graphical Engineering Station (Black Box).


TC = 7.52-trail version.    TC lang.= VBScript.    Application=C++, using Codejock SoftWare.


TC does not recognize DIFFERENT Input-boxes in Dialog Windows (when I have more than one Input-box in Dialog).

But TC can recognize other controls. Dialogs were written on C++ only.


Example: we have a task to enter “1” into the 1st input-box, and then enter “2” into the 2nd input-box.


TC has generated the following code:



Sub Test1


  Dim edit


  Set edit = Aliases.SimClient.dlg.Edit


  Call edit.Click(46, 11)


  edit.wText = "1"


  Call edit.Click(48, 11)


  edit.wText = "2"


End Sub




RESULT: “1” was entered into the 1st input-box, and then “2” was entered into the 1st input-box instead of “1”.

=============================================================================


At the same time, other controls are OK (TC numbers them or uses their names).

Example: we have the task to select an items in 2 list-boxes:


Sub Test2


  Dim dlgAnimation


  Set dlgAnimation = Aliases.SimClient.dlg


  Call dlgAnimation.ListBox2.ClickItem("[Electric]")


  Call dlgAnimation.ListBox.ClickItem("EL_AVR_EXC.bmp")


End Sub



==================================================


I wrote the manual script with the numbering of input-boxes:


Sub Test3


  Dim dlgROTATE


  Dim edit


  Set dlgROTATE = Aliases.SimClient.dlg


  Set edit = dlgROTATE.Edit


  Call edit.Click(61, 😎


  edit.wText = "1"


  Set edit = dlgROTATE.Edit1


  Call edit.Click(29, 12)


  edit.wText = "2"


End Sub






But it does not work. Log-Report: 'Unable to find the object Edit1.'    


Could you, please, help me?


Thank you in advance.


1 REPLY 1
YMinaev
Staff

Hi,



The problem is in Name Mapping - all input boxes meet the same recognition criteria. To overcome this, you need to use indexes to distinguish among them. Either map each input box manually and use its Index property when mapping to recognize it, or avoid using Name Mapping at all. If you choose the second approach, you'll be able to use code like this:

...

Set wnd = Aliases.SimClient.dlg



wnd.Window("Edit", "*", 1).wText = "1"

wnd.Window("Edit", "*", 2).wText = "2"

...

------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: