Ask a Question

Do I really need the coordinates when I click on an item?

SOLVED
mustafayol
Occasional Contributor

Do I really need the coordinates when I click on an item?

Hi friends,

 

I am testing windows desktop software.

During the tests I use "record and play" method,  and click on certain buttons within the scenario.

 

appTextBoxMaskBox.Click(2, 5);
appTextBoxMaskBox.Click(94, 4); 

 

My question is "Do I really need the coordinates when I click on an item?"

or is there a generic way to click always on the center of the element?

 

Many Thanks

Mustafa

 

1 ACCEPTED SOLUTION

Accepted Solutions
hkim5
Staff

Re: Do I really need the coordinates when I click on an item?

ideally, you should never have to rely on coordinates when you perform Click() operations on your objects.

Given that Testcomplete can uniquely identy the objects themselves (easy way to tell is take the object spy and see if it creates a red rectangle around whatever object you want to interact with)

then you do not need the coordinates parameters within your Click operations.

the reason for those being recorded may be that TC wants to be as accurate as possible when transcribing your recorded actions, but it is definitely not necessary in alot of cases.

you can edit it to be blank, or call on default coordinates (with is dead center of the object -1, -1)

so that would be

testedObj.Click() 

or

testedObj.Click(-1, -1)

Best,
Justin Kim

View solution in original post

2 REPLIES 2
hkim5
Staff

Re: Do I really need the coordinates when I click on an item?

ideally, you should never have to rely on coordinates when you perform Click() operations on your objects.

Given that Testcomplete can uniquely identy the objects themselves (easy way to tell is take the object spy and see if it creates a red rectangle around whatever object you want to interact with)

then you do not need the coordinates parameters within your Click operations.

the reason for those being recorded may be that TC wants to be as accurate as possible when transcribing your recorded actions, but it is definitely not necessary in alot of cases.

you can edit it to be blank, or call on default coordinates (with is dead center of the object -1, -1)

so that would be

testedObj.Click() 

or

testedObj.Click(-1, -1)

Best,
Justin Kim

View solution in original post

mustafayol
Occasional Contributor

Re: Do I really need the coordinates when I click on an item?

Many thanks for the answer, I removed all coordinates and scripts still run.

best regards

Mustafa

cancel
Showing results for 
Search instead for 
Did you mean: