Forum Discussion

forrestaustin's avatar
forrestaustin
Contributor
6 years ago

Is there a way to Standardize screen resolution for steps using pixels

One of my controls is not supported by TC and is therefore just recognized as a big rectangle. I can still record a test where I click within the control and TC just remembers the pixel location.

 

This worked fine for me until I started performing my test on other computers. On other computers the same spot was not always clicked and therefore different items were selected. 

 

All of the tests will run on vm workstations. I am wondering if there is a way to standardize the screen resolution so that click(20,20) clicks the same place no matter what computer it is run on. I don't know much about what factors affect this, so any suggestions would be appreciated. 

8 Replies

    • forrestaustin's avatar
      forrestaustin
      Contributor

      Thanks for the suggestion. Last time I contacted them they couldn't identify the problem without me sending them the test application (which is 100% not possible) so I am a little hesitant to try again but I suppose it couldn't hurt. 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Rather than using screen resolution and click co-ordinates, there are other ways of getting this to work better.

     

    1) There's a "Text Recognition" feeature of TestComplete that allows you to identify objects by the text string. (https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/improving/using-text-recognition/about.html)

    2) There's OCR (https://support.smartbear.com/testcomplete/docs/testing-with/advanced/ocr/index.html)

    3) You can also try adding your component to TestComplete by modifying the Object Mapping of your project to include your class of object. (https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/improving/mapping.html)

     

    There are several other options available to you as well... I would suggest investigate these as relying on pixel location is, as you've noticed, very unreliable.

    • forrestaustin's avatar
      forrestaustin
      Contributor

      Hi Tristan, thanks for the response. What I meant by not supported by TC is that none of those options (besides optical character recognition worked for my control). I investigated mapping the class to a supported one and tried to use the text recognition method. Neither of them worked. I have not tried optical character recognition, but that sounded like it could have problems with different screens having different resolutions and is why I have refrained from trying. 

       

      I would like not to have to rely on pixel clicks, but I can't get the alternative ways to work.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I'm assuming this is a desktop application?  If so, what platform is it written in?  And what version of TestComplete are you running? And what is the class name that shows up for that larger component (your big box) when you look for it in Object Spy?

         

        It MIGHT be that there are more native ways of getting to your desired components... or, perhaps, there's some preparation that needs to be done to your application to expose more components.