Groovy Script in Virt to generate html page with a button on it.
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?
Re: Groovy Script in Virt to generate html page with a button on it.
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. ⬇️⬇️⬇️