Ask a Question

How to Get Text from WebPages and Connect with C#

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

 

 

5 REPLIES 5
tristaanogre
Esteemed Contributor

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
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
TanyaYatskovska
SmartBear Alumni (Retired)

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 Yatskovskaya
SmartBear Community and Education Manager



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.

TanyaYatskovska
SmartBear Alumni (Retired)

Hi @bistritapcv,

 

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

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



TanyaYatskovska
SmartBear Alumni (Retired)

Hi @bistritapcv,

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

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: