Cannot download a pdf when using headless mode !?


#1

Hello,

being new to Katalon (v7.0.7 on Mac) I used ‘record web’ to automate login to a web site and download a PDF from the site, which worked well.

Executing the test case works well both with Firefox and Chrome.

BUT: When I try to run the test case using a headless browser (both Chrome and FF), the PDF is not written to disk.

Any idea what is wrong?

Best regards, Michael


#2

Hi @michael.seyfried

It’s hard to say, can you post the relevant console log ? How are you downloading the PDF ? Are you clicking on a button, or using code ?


#3

Hi Thanh,

i click on a button on the website.

LOG:

2019-11-08 10:28:28.157 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-11-08 10:28:28.165 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/MYY-191107
2019-11-08 10:28:30.075 DEBUG testcase.MYY-191107 - 1: openBrowser("")
2019-11-08 10:28:30.914 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Chrome (headless)’ driver
Nov 08, 2019 10:28:30 AM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using new ChromeOptions() is preferred to DesiredCapabilities.chrome()
2019-11-08 10:28:30.983 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 seconds
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 21936
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Nov 08, 2019 10:28:34 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
2019-11-08 10:28:34.476 INFO c.k.k.core.webui.driver.DriverFactory - sessionId = 199ff9d7721fb658e278cff613d5af5e
2019-11-08 10:28:34.497 INFO c.k.k.core.webui.driver.DriverFactory - browser = Chrome 78.0.3904.87
2019-11-08 10:28:34.498 INFO c.k.k.core.webui.driver.DriverFactory - platform = Mac OS X
2019-11-08 10:28:34.499 INFO c.k.k.core.webui.driver.DriverFactory - seleniumVersion = 3.141.59
2019-11-08 10:28:34.501 INFO c.k.k.core.webui.driver.DriverFactory - proxyInformation = ProxyInformation{proxyOption=NO_PROXY, proxyServerType=HTTP, password=, proxyServerAddress=, proxyServerPort=0}
2019-11-08 10:28:34.513 DEBUG testcase.MYY-191107 - 2: navigateToUrl(“https://epaper.MYY.info/#storefront/6”)
2019-11-08 10:28:41.440 DEBUG testcase.MYY-191107 - 3: click(findTestObject(“Object Repository/Page_M_Y_Y - E-Paper/span_Anmelden”))
2019-11-08 10:28:45.340 DEBUG testcase.MYY-191107 - 4: setText(findTestObject(“Object Repository/Page_Registrieren - aboMYYch/input_E-Mail-Adresse_login”), "myemail@macme.com")
2019-11-08 10:28:45.725 DEBUG testcase.MYY-191107 - 5: click(findTestObject(“Object Repository/Page_Registrieren - aboMYYch/button_Weiter”))
2019-11-08 10:28:45.892 DEBUG testcase.MYY-191107 - 6: setEncryptedText(findTestObject(“Object Repository/Page_loginMYYch - Login/input_Passwort_password”), “hash-value-of-password”)
2019-11-08 10:28:47.305 DEBUG testcase.MYY-191107 - 7: click(findTestObject(“Object Repository/Page_loginMYYch - Login/button_Anmelden”))
2019-11-08 10:28:47.490 DEBUG testcase.MYY-191107 - 8: click(findTestObject(“Object Repository/Page_M_Y_Y - E-Paper/span_PDF herunterladen”))
2019-11-08 10:28:49.440 DEBUG testcase.MYY-191107 - 9: click(findTestObject(“Object Repository/Page_M_Y_Y - E-Paper/span_Name_fup-login-open-icon fup-m_6f9864”))
2019-11-08 10:28:50.085 DEBUG testcase.MYY-191107 - 10: click(findTestObject(“Object Repository/Page_M_Y_Y - E-Paper/span_Abmelden”))
2019-11-08 10:28:50.190 ERROR c.k.k.c.w.keyword.builtin.ClickKeyword - :x: javascript error: Failed to execute ‘elementsFromPoint’ on ‘Document’: The provided double value is non-finite.
(Session info: headless chrome=78.0.3904.87)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘mpb1315’, ip: ‘fd78:6256:f349:aa00:5815:1b57:7695:b361%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.15.1’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.87, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024…, userDataDir: /var/folders/63/3g108h11757…}, goog:chromeOptions: {debuggerAddress: localhost:50414}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 199ff9d7721fb658e278cff613d5af5e
2019-11-08 10:29:20.458 ERROR c.k.k.c.w.keyword.builtin.ClickKeyword - :x: javascript error: Failed to execute ‘elementsFromPoint’ on ‘Document’: The provided double value is non-finite.
(Session info: headless chrome=78.0.3904.87)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘mpb1315’, ip: ‘fd78:6256:f349:aa00:5815:1b57:7695:b361%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.15.1’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.87, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024…, userDataDir: /var/folders/63/3g108h11757…}, goog:chromeOptions: {debuggerAddress: localhost:50414}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 199ff9d7721fb658e278cff613d5af5e
2019-11-08 10:29:20.543 DEBUG testcase.MYY-191107 - 11: closeBrowser()
2019-11-08 10:29:20.717 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/MYY-191107