I m currently automating a Desktop application using C# NUnit, TestLeft, most of the objects identified are MSAAObjects.
I want to click on an object which is not visible on screen and I get the following error
SmartBear.TestLeft.TestObjects.InvocationException: 'There was an attempt to perform an action on a zero-sized window.
The window size is (0, 0); the screen rectangle: the left top corner is (0, 0), the right bottom corner is (0, 0)
There is a bit of scrolling involved to get the object visible on screen, so I tried
//obj is of type IMSAAObject
But this takes ages to get to that object.
Is there a proper way to scroll to view the object? This is a MSAAObject, so there is no Focus() or ClickItem() options
Any sort of help is appreciated
Thanks in advance
As a quick idea and assuming that the problematic control resides on some form with scrollbar:
Try to send .Keys("[PgDown]") not to the desktop, but to the proper scrollbar of the form.
Thanks for the response,
I did use the .Keys("[PageDown]") on the scrollbar, it does scroll to display next set of objects. However I was hoping to find a better way to bring the intended object to display by using that object iteslf.
At any given scrolled position I should be able to find that object(that object can be at the top(Up) or bottom(Down) of the form irrespective of the current scrolled position).
For now I am using
//1019 is the ScreenTop value(position of the indicator) of the scroll indicator when it is scrolled down to maximum
var downMax = false;
if (scrollBarIndicator.ScreenTop < 1019 && !downMax)
down = true;
This works, but, is there a nicer way to get to the object which is not visible on screen?
> is there a nicer way to get to the object which is not visible on screen?
I'm afraid that there is not...
TestComplete (and TestLeft) can automatically put into view quite a few controls, but not MSAA ones, according to my knowledge.
For official reply you may ask Support directly via the https://support.smartbear.com/message/?prod=TestLeft form and I will appreciate it if you update this thread in case they provide better solution.