Silentkiller Respected Contributor.
Respected Contributor.
1498 views

Unable to find Read Web page operation in OO 10.7

Jump to solution

Hi Experts,

In Studio documentation,there is an example of using Read Web page operation in flow.

However I am using OO 10.7 but could not find that operation.

I had imported all content packs during studio installation.

Is this operation still valid or is there any other operation which can perform same task.

My idea is to read a text in a webpage.If  internal server  error text apperas then flow must restart application service

 

Tags (2)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Unable to find Read Web page operation in OO 10.7

Jump to solution

Hi,

The output is based on wether it could read the page or not. In this way regardless of the status code of the api call the result will always be success (status code 2xx-5xx ) always will result in success. 

You can create a scriptlet based on the  contents of the result fields to force the failure behavior.

For example to fail for status code the scriptlet looks like this:

statusCode = parseInt(scriptletRawResult['statusCode']);
if (statusCode >= 300)
{scriptletResponse = "failure";}

Hope this helps,

Vlad

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Unable to find Read Web page operation in OO 10.7

Jump to solution

Hi,

Within flows  the best practice is to rename the steps to highlight what the step does in order to make the flows easier to debug and maintain. As such if in the screenshot it says "Read Web Page" it usually refers to an http client get operation that reads some information from the page. 

If you have a page that can display an internal server error type message are there no rest/soap api behind it which would also return that error? In this case an http client  call on that api would be preferable as opposed to reading the html page itself. 

Hope this helps,

Vlad

Silentkiller Respected Contributor.
Respected Contributor.

Re: Unable to find Read Web page operation in OO 10.7

Jump to solution

Hi VladM,

Yes http client get operation can read web page.

But I believe output of step is based on http status code also

Can I tweak the step like only if text is found then pass the step irrespective of status code else fail the step

 

 

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Unable to find Read Web page operation in OO 10.7

Jump to solution

Hi,

The output is based on wether it could read the page or not. In this way regardless of the status code of the api call the result will always be success (status code 2xx-5xx ) always will result in success. 

You can create a scriptlet based on the  contents of the result fields to force the failure behavior.

For example to fail for status code the scriptlet looks like this:

statusCode = parseInt(scriptletRawResult['statusCode']);
if (statusCode >= 300)
{scriptletResponse = "failure";}

Hope this helps,

Vlad

0 Likes
Silentkiller Respected Contributor.
Respected Contributor.

Re: Unable to find Read Web page operation in OO 10.7

Jump to solution

Thanks VladM,

It worked perfectly

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.