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