cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving data from website without going to it.

steventwerd
Occasional Contributor

Retrieving data from website without going to it.

Hi,

I want to read some data from the BBC Website such as today's weather and store it in a variable. I know this can be done by recording a test going to the website and saving the value on the screen. Is there a way to do this without having to go directly to the website (without having to do all the clicks and typing to get to the website).

I was thinking an API or Web-Service is the right call but I don't know of an API that can connect to any website and a web-service requires a WSDL document which I don't quite understand.

Can anyone point me in the right direction?

4 REPLIES 4
Marsha_R
Community Hero

Re: Retrieving data from website without going to it.

APIs are specific to the application(s) involved.  

https://en.wikipedia.org/wiki/API

 

It's possible that BBC has one in place for what you are looking for.  Take a look on their website and see.  If you find something that looks like it will work, then post back here and we can help you set up to use it in TC.

 

steventwerd
Occasional Contributor

Re: Retrieving data from website without going to it.

Hi @Marsha_R 

I couldn't find an API for BBC website unforunately but I would still like to learn how to use an API so I got the Weather API (free weather api I found online) and now I got an API key and all that. How would I go about using this in a TestComplete Test?

Marsha_R
Community Hero

Re: Retrieving data from website without going to it.

@AlexKaras I believe this is your domain  🙂

AlexKaras
Community Hero

Re: Retrieving data from website without going to it.

Hi,

 

Not that it is my domain, but nevertheless...

Basically, web services are of REST or SOAP type (the former is architectural approach while the latter is standard).

TestComplete provides extended support for SOAP web services via the Web Services item type (https://support.smartbear.com/testcomplete/docs/app-testing/web/services/overview.html) and limited support for REST via the aqHTTP object.

 

If you are looking to get a weather data from the BBC site and there is no information (StackOverflow or plain Google) or documentation on the site itself about how to do this, I would capture traffic issued by the browser when navigating to the page that contains weather information using some recording proxy (Fiddler for example) or browser's developers tools, analyze captured traffic and search for request(s) that request and obtain weather data. Then examine parameters required by request (URL parameters, request parameters, request body data) and craft corresponding request in TestComplete to get the data that I need.

 

If you just like to get a practice with some free sample web service, then you need to check its documentation (either written or documented, say, using Swagger) and, again, create corresponding request in TestComplete.

For more detailed talk you might want to let us know the link to the web service you'd like to work with.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements