ATF : Can we test the URL link in content item?

S_59
Tera Contributor

Hi,

I am new to ATF and testing some content items in portal page. we defined a URL in the content item which redirects to new tab ex: Yahoo new URL is defined in the below content item. I need to test if yahoo news is opening or not? can we achieve this using ATF? If yes, please guide me through the steps.

 

S_59_0-1703983130003.png

 

 

Thanks,

Sai 

2 ACCEPTED SOLUTIONS

Amit Verma
Kilo Patron
Kilo Patron

Hi @S_59 

 

URL availability check can't be achieved directly. We can make use of the following ways to get it done :

 

1. We can make a REST API GET call to the URL from ServiceNow instance using Rest Message. If the website is available, you should get 200 as a response. If any other response, you can infer that the website is down.

 

2. You can make use of a PowerShell script to achieve this. The PowerShell script can check the URL availability and return you the status. The PowerShell script could be configured as a Mid Server Script file which could be called from a Flow Designer action via PowerShell Step or via Custom Action in Workflow Designer.

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

View solution in original post

Hi @S_59 

if you really want to test the availabilities of the external links, you should separate this is an individual server-side ATF. That ATF-Test can collect the links from all content items and perform a "ping", for example with the help of a REST Message.

Maik

View solution in original post

5 REPLIES 5

Maik Skoddow
Tera Patron
Tera Patron

Hi @S_59

 

in ATF you shouldn't mix responsibilities, as you are not responsible for the availability of the specified website. What if the target website is down just at the moment your ATF test is running? The test will fail, although nothing has changed. This will create a false finding and some troubles but again, you are not responsible for the target website's availability!

 

Maik 

Hi Malik,

I created this example for posting purpose. In my actual requirement the content items are redirecting to different department pages in our website( example: one URL takes you to cafeteria page, one URL takes you to Parking page etc.,). Recently some of the URLs are not working and getting 404 or 502 bad gateway errors. So management asked me if I can add these content items in my regression testing. To test my content item (ex: cafeteria) I am using "click on UI component" test step and it is redirecting to the URL in a new tab and test is pausing and I have to manually switch back to Client Runner browser. I am wondering is there any way to test if these links are working or not?

Thanks,

Sai

Hi @S_59 

if you really want to test the availabilities of the external links, you should separate this is an individual server-side ATF. That ATF-Test can collect the links from all content items and perform a "ping", for example with the help of a REST Message.

Maik

Shaqeel
Mega Sage

Hi @S_59 

 

If you need to validate the url you can do it by using "Assert Text on Page" but if you need to validate the url is working or not you can not do.

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel