Forum Discussion

whuang's avatar
whuang
Regular Contributor
4 years ago

Is there anyway to select text on a webpage by TC?

Hi there,

 

I have a test need to visually select some text on a page, is TC able to handle that other than by using keywords record? Because by replaying keywords recording is not reliable, if my display settings changed, test will fail.

 

Thanks in advance

    • whuang's avatar
      whuang
      Regular Contributor

      Thanks for the suggestion, yes, I was using coordinates. I think that is the default setting when recording keywords test, but anyway, I don't see there is anyway to identify text (not paragraph) by using object name. Like if I want to select "what causes the problem" from your reply above. Moreover, I will also need to select text from a PDF file opened in a browser, maybe that is more difficult?

      • Marsha_R's avatar
        Marsha_R
        Moderator

        The tasks are not difficult but sometimes it is difficult to help when we don't have all the parts of the question at once.  🙂

         

        1) Yes, coordinates are default from recording a keyword test but that doesn't mean you have to keep them, in fact it is recommended that you don't.  TC starts from coordinates because it doesn't necessary have a name mapping for your objects when you begin recording but you should be able to switch eventually.

         

        2) If there is a string on a web page, then it's usually a label or some other text piece of an object and you start with the object and then add on the field where the text lives.

         

        3)  If you are trying to test a pdf, then this may help

        https://support.smartbear.com/testcomplete/docs/testing-with/working-with-external-data-sources/pdf.html