cancel
Showing results for 
Search instead for 
Did you mean: 

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

whuang
Frequent Contributor

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

5 REPLIES 5
Marsha_R
Community Hero

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

Are you using coordinates or an object name to select the text? 

 

Coordinates is usually what causes the problem when display settings change, so if that's what you're doing, use an object name instead. 

 

If you are using the object name but it can differ each time because the web page changes names a little, then you need to look at using wildcards.

https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html

whuang
Frequent Contributor

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

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
Community Hero

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

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....

sonya_m
Community Manager

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

Thank you Marsha!

 

@whuang does the suggestion help?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
whuang
Frequent Contributor

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

Not really, but it is ok, we are not going to automate it anymore. Thanks for the help!

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors