How do I get past Ranorex clicking the wrong item because of resolution differences?

576 Views Asked by At

I'm maintaining tests written by another developer before I joined the organization. These tests use Ranorex to verify the functionality of a windows application.

The issue is that when the tests are running one of them will seemingly at random click on a dropdown in the top left corner of the application and click an item in that dropdown that closes the application.

This is not a step that we have coded into our tests and is clearly errant clicking. The developer that originally created these tests suggested that it might be an issue arising from using a different screen resolution than the tests were written in.

These tests need to run in a specific order and one other odd detail is that when I run each test individually I don't see this error but when I run the tests all at once and in the order they're supposed to run I will see the issue.

The issue doesn't happen at the same spot in the test suite. It happens at different spots in four different tests each time out of the 12 tests that I'm able to run with this issue. On a side note the number of tests isn't always 12, the number of tests that run depends on when this issue occurs.

Any tips on how to stabilize these tests that I have seen pass but when run all together will close the application?

Note: These are not recording tests, they are coded tests.

1

There are 1 best solutions below

0
On

If you are dependent on the test agent screen resolution (for example to click on controls that are not recognized by Ranorex), one trick I used was to set the window size to a known size. Choose a size that will fit the resolution of any test agent that you plan to run the test on.

Another trick I used was to use keyboard shortcuts or keypresses instead of mouse clicks.

As for coded tests, remember that you can use a combination of recordings and spy to create sequences and see how code generated in Ranorex does work (basically a recording is only the recipe to create code automagically).

Hope those tricks can help you.