Ask a Question

Has anyone had any joy creating and running tests on different size monitors

SOLVED
MegO
Contributor

Has anyone had any joy creating and running tests on different size monitors

Hi all,

 

My colleague and I are responsible for creating and running tests in TestComplete for our Desktop application.

 

The problem we face is that we both have different size monitors/Laptops with different resolution etc.

 

This means that tests created on one don't reliably work on the other.

 

Has anybody else faced this issue and how did they solve it?

 

Any ideas or suggestions would be greatly appreciated.

 

 

17 REPLIES 17
shankar_r
Community Hero

Hi,

 

We do have same short of scenarios with Java applications.

 

The main problem for us is scrolling.

When i was developing scripts for my AUT with big monitor i never seen any scroll bars in it.

 

Then i ran in the small size monitor it doesn't worked since it is not able scroll by own to see the objects.

 

By that time, I used to create scripts to handle that scrolls as well to cut off the false failures 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

baxatob
Community Hero

Hi,

 

First of all - why your tests depend on screen resolution? Are you using image based tests or clicking by coordinates or may be something else?

 

The best practice requires that tests were independent from infrastructure changes.

Hi baxatob,

 

We use the click and record functionality of TestComplete for the majority of our tests. We replace click co-ordinates with -1, -1 as advised to click on the centre of an object rather than rely on the co-ordinates. Our Name mapping is dynamic (Using wild cards, AutomationIds etc)so that objects can be identified no matter where they are on the screen.

 

The errors we usually see are "There was an attempt to click out of the windows bounds". The Tests run correctly when run on a laptop but fail when ran on a larger monitor. 

 

It looks like the pixel difference is the cause of the issues...

The errors we usually see are "There was an attempt to click out of the windows bounds". The Tests run correctly when run on a laptop but fail when ran on a larger monitor. 

 

 

This was the error we also used to get. Mostly it is related the scroll or object displayed partially on the screen when you run in small screen. 

 

@baxatob correctly pointed, Automation scripts should always  in-dependent from infrastructure. 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

Hi shankar_r

 

The difference is we get this error on the large monitor not the smaller screen where the tests were initially created.

 

Also I was lead to believe that by removing the click co-ordinates etc this is how you make the tests independent of infrastructure, or is there a better way?

Basically, when we do want to do some actions on the objects i would add below conditions.

 

  1. TestObject.Exists
  2. TestObject.Visible
  3. TestObject.VisibleOnScreen

If all above conditions matches then i would assume there won't be any harm in doing things like click or keys.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

I have tested this using the find object method in TestComplete.

 

Essentially we find the object that we want to click on and then if it exists we click on it.

 

Test still do not run on the bigger monitor.

cunderw
Community Hero

Can you provide the code or KWT segment for an example failure and screenshots for both monitor sizes? 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped

Hi cunderw

 

This is an example of how we find objects and then click on them:

 

var PropNames, PropValues;
PropNames = new Array("Name");
PropValues = new Array("Value");
Aliases.*.Find(PropNames, PropValues, 1000, true).Click();

 

Our large monitor resolution is: 1920 x 1080 - This is where tests fail

Our smaller screen resolution is: 1536 x 864 - This is where the majority of tests are created and run successfully.

 

 

cancel
Showing results for 
Search instead for 
Did you mean: