Ask a Question

Unable to obtain the item's rectangle (can't click VB object)

jsmith1979
Occasional Contributor

Unable to obtain the item's rectangle (can't click VB object)

I'm evaluating TestComplete to see if it'll work for my company. Unfortunately, I'm not able to play back even basic keyword tests. I'm able to record and the test operations look okay. But TC can't "see" the objects I want to click. It just waits and then gives up like so:



Waiting until the item becomes visible...

Waiting for the X object...



See attachments for examples of my test operations and error log. Note these are just examples, I know the error log doesn't match up with the test.



Unless I can find some workaround for TestComplete to be able to "see" and click on these objects, or convince the programmers to change the GUI (unlikely!), I won't be able to use it to automate my tests.



Any help or ideas appreciated... thanks!
7 REPLIES 7
jsmith1979
Occasional Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

Oh, and when I use the Finder Tool, it doesn't put a red rectangle around the "button" that I want to click, it puts one around almost the entire window of our application. Some objects in our application can be individually highlighted, but many of these label-type ones cannot. It just highlights the entire frame of the window (minus menu and titlebar).
syedsafvan
Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

John,



It looks like you are working with an application built in VB6.0. As VB6.0 does not provide a extensive control box most applications built on this use 3rd party controls. Could you please tell us what is the control you are working on?

And almost all the major 3rd party controls for VB 6.0 are supported by TC. 





Thankyou




Syed Ahmed Safvan

jsmith1979
Occasional Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

Syed,



Our current control is a "label" type of control from the MS Forms 2.0 library.



It may not matter, actually, as the replacement for the buttons will be something else entirely that may be even *more* difficult for TC to see.



So I guess my next question is, is there a way I can revert to the more primitive coordinate-based system of clicking on buttons (e.g. like vTask Studio uses)? I know that's not as robust a method of creating tests, since if the programmer moves buttons around, the test breaks. But at this point it may be my only option.



Thanks.
jsmith1979
Occasional Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

Okay, I've started trying out the "record low level procedure" recording option. That seems to do what I want, but when I hit "Run Test", it doesn't minimize TC, so it goes through all the mouse motions with the TC window still in the foreground.
jsmith1979
Occasional Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

In answer to my own question: you can use the SetFocus method for the application's window to bring it to the front and then execute the low level procedure.



So it looks like I'm able to use TC afterall. I can't record the entire test, I have to break it up into section of regular keyword test and section of low level procedures. But it is working!
syedsafvan
Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

🙂 Cool John

Syed Ahmed Safvan

jsmith1979
Occasional Contributor

RE: Unable to obtain the item's rectangle (can't click VB object)

Here's my final script, using Low Level Procedures where there were parts of the program where TestComplete couldn't "see" the VB label object buttons. Hopefully this will help other people who run into the same problem when testing a VB6 app.
cancel
Showing results for 
Search instead for 
Did you mean: