cancel
Showing results for 
Search instead for 
Did you mean: 

How to Get Text from WebPages and Connect with C#

Contributor

How to Get Text from WebPages and Connect with C#

I am testing a form.  Below is a part of it (without divulging any confidential information).

The two fields (city and state) are located by 

    ["SwingObject"]("HighlightField", "", 3) and 

    ["SwingObject"]("HighlightField", "", 4)

 

I am fairly certain I have located the elements, and I would like to figure out how to determine the value (i.e, "CHICAGO" and "IL") from the element.  I have tried a few things.  I would like to put these into string variables so I can compare their output to something.

 

Again, please see attached image.

 

 

Tags (1)
5 REPLIES 5
Community Hero

Re: How to Get Text from WebPages and Connect with C#

If you use the object spy https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/index.html?q=... you can examine the components themselves and look at the various available properties.  I'm assuming that somewhere in those properties is something like "Text" or "Caption" or "wText" or "Value" or something to that extent which will contain what's in those fields.

With that, you can then use an Object Property Checkpoint https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/property/index.html to validate the value of the property and return a pass/fail on it.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Manager

Re: How to Get Text from WebPages and Connect with C#

Hi @bistritapcv,

 

Did you find the property you can use? If you haven't, make sure that you are using the Advanced view mode in The Object Browser to see all properties. Refer to the following articles for details:

https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-browser/view-mode...

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

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

Re: How to Get Text from WebPages and Connect with C#

I tried several objects (different levels) and different properties, but all I got was like COM_OBJECT as a string.  Something that provides more information I just realized.  This window that opened from which I am trying to get text is a web page via Internet Explorer.  But I am not using Selenium or I would know how to do it.

Community Manager

Re: How to Get Text from WebPages and Connect with C#

Hi @bistritapcv,

 

Is this page available on the Internet? please give us a link.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Community Manager

Re: How to Get Text from WebPages and Connect with C#

Hi @bistritapcv,

I just want to understand if you need any more assistance. Was the issue resolved?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
API Testing Mistake #2
APITestingMistake#2
Top Kudoed Authors