Katolon recorder: print/save pages


#1

Hi:

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: https://plattemo.icounty.com/iRecordWeb2.0/login.aspx
–> 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,
Koleman


Print/save pages
#2

I don’t think you can trigger page saving with the selenium ide, it is not designed for this. Solution: Use a tool to simulate keystrokes, e. g. Ctrl+S to save a page, or Ctrl+P (print to PDF) to print.


#3

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

WebUI.openBrowser('https://plattemo.icounty.com/iRecordWeb2.0/login.aspx')

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)

#4

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


#5

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.

Best,
Koleman


#6

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.)


#7

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


#8

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


#9

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)


#10

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)


#11

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

image


#12

Script1550678167729.zip (7.8 KB)

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