Forum Discussion

adibrao's avatar
adibrao
New Contributor
7 years ago

How do I click a specific text using OCR if I have more than one similar text in that Page ?

For example , There are five texts named " Login" in my Page and I wanted to click the third "Login" text . How can I do this with OCR using vb script ?

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I guess the first question I have is why are you using OCR to find something to click on?  Is there a reason why the Login item is not able to be recognized distinctly?

     

    What you have described is one of the main problems with OCR... all it can do is recognize that there is text matching a particular string... it doesn't tell you anything about whether or not it is the CORRECT text you want for interaction.  Perhaps if you can explain why you are using OCR, we might be able to come up with a better solution for you.

     

    As it is... What does your AUT look like in TestComplete's object browser?  What type of application is it?  When using Object Spy (with OCR disabled), how do the Login items display?

    • adibrao's avatar
      adibrao
      New Contributor

      Thanks for reply . "Login" is just an example. Actually, I have to select a specific name from MSflexgrid .I can't use click cell method in MS FlexGrid. So I tried to click with OCR and it works fine. But it doesn't work when there are more than one similar name

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Ah, MSFlexGrid... yeah, we have to deal with those, too, in our application under test.  Honestly, if you can find a nice, clean way to click on the contents of a cell within an MSFlexGrid, let us know.  As it is, our testing requirements in this situation is not to test the buttons in the grid, but to test the workflow around the data and we have alternative options to interact with contents of the grid.