Katolon recorder: print/save pages


I am a new users and I am hoping this is just a simple question to which someone can point me to the relevant documentation.

I am trying to automate downloads from a page where search results are generated via javascript: essentially I get pages of results, and I want the recorder to click on watch page, load the results and then print the outcome (I would like a PDF but saving the original HTML can work too).

I have not had problems automating the clicking on each page but am unsure on how to print/save each page. Is this something which can be done (I am doing this using Chrome on a Win 10 OS).

For reference the start page is: iRecord Client Login
→ you can log-in as guest with no password. I am glad to supply my specific search query on the next page if that would help.

Thanks for any help on this,

This worked for me. Let me know if you have any questions.


WebUI.waitForElementClickable(findTestObject('Logon button'), 10)

WebUI.click(findTestObject('Logon button'))

WebUI.waitForElementClickable(findTestObject('Business or Last Name input'), 10)

WebUI.sendKeys(findTestObject('Business or Last Name input'), 'Jones')

WebUI.sendKeys(findTestObject('Business or Last Name input'), Keys.chord(Keys.ENTER))

def html = WebUI.getAttribute(findTestObject('Results div'), 'innerHTML')

new File('myresults.html').append(html)

Thanks Tim. Is there a way to integrate Xtype within Katalon recorder?

Thanks Harold!

Are these commands for Katalon Studio (rather than Recorder)? I am not sure how I can enter these as Recorder commands. Sorry I really am a newcomer with Katalon.


Yes, these would be script commands in Katalon Studio. Record what you can in Recorder, then open test case in Katalon Studio and click on the Script mode tab at the bottom.

Then add the last two script lines. (The other lines should be in there from Recorder.)

Thanks Harold. I am installing Studio now and will be back after I give it a go.

Ugh I have not had much luck with Katalon Studio.

When I try a simple script like Harold suggest I get a message about test cases being terminated. I am not sure the right file to upload so I attach a few screen shots.Capture1

Here is the *.groovy file I am using (this one I made via the Recorder in Studio). I still get the same termination message as above.Script1550078963623.zip (749 Bytes)

I got this to run but the script fails on the two lines which Harold suggested. My script and log are attached.

If anyone who can give it a look and has suggestions i would be most appreciative.Script1550078963623.zip (1.5 KB)

Below the script are tabs. Click Console and send the console messages. That would help to troubleshoot.


Script1550678167729.zip (7.8 KB)

Attached is the console log (along with the updated groovy file and error log)

Do you have an object called “Results div” defined under Object Repository?
> 2019-02-20 14:42:52.305 e[39mDEBUGe[0;39m e[36mtestcase.New Test Case -e[0;39m e[39m11: html = getAttribute(findTestObject(“Results div”), “innerHTML”)e[0;39m
> 2019-02-20 14:42:52.305 e[31mWARN e[0;39m e[36mc.k.k.core.testobject.ObjectRepository -e[0;39m e[39mTest object with id ‘Object Repository/Results div’ does not existe[0;39m

Thanks Harold. I got this to work, I appreciate the assistance.

Here is a thread where I posted my working code: For loop: access looping variable as string