Groovy Script in Virt to generate html page with a button on it.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2018
04:46 AM
05-10-2018
04:46 AM
Groovy Script in Virt to generate html page with a button on it.
Hi,
I am new to ReadyAPI Service Pro. Need my Virt to generate an html page which has a button on it. On click it should be navigating to a link saved in a csv file.
I believe it needs a piece of Groovy code which embeds html into it. Can anyone please help?
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018
09:37 AM
09-12-2018
09:37 AM
Hi Aradhna,
Thank you for your post. To create an HTML page as a response in ServiceV, you need to select the text/html as the Content | Media Type value. The below HTML can be used to create a page with a button and link:
<html> <input type="button" value="Link" onclick="window.location.href='https://www.smartbear.com/'" /> </html>
Please see the sample screenshot:
Please see the following article about scripting in ServiceV: Virtual Service Scripting.
Also, here is the article about reading from an Excel file which also could help you:
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
