Using Karate, I have problem, when I run test in headless mode (from Jenkins). I am not able to reach pdf attachment url from email. When I run it locally with non-headless mode, it works fine.
I am using: karate.configure('driver', { type: 'chrome', headless: true, addOptions: ['--disable-dev-shm-usage','--no-sandbox']});
Task is:
I am logged in email account
I go to email detail
Email has PDF attachment with url.
Url is constructed by domain name and by the link from "href". Then I want to go to that url, but error occurs:
def linkElement = locate('{^a}Show')
def linkValue = linkElement.attribute('href')
def emailDomain = "https://email.seznam.cz"
def linkValue = emailDomain + linkValue
Given driver "https://email.seznam.cz" + linkValue
com.intuit.karate.exception.KarateException: com.intuit.karate.exception.KarateException: ASD.feature:162 - failed to get reply for: [id: 695, method: Page.navigate, params: {url=https://email.seznam.cz/download/j/qZv4hRVnOXMkjn0JSTxyLUBZVKfXwoftYZ6ar7jwQtn3OqiGGrQwyIb1yP-SgdSLrw3gF5s/pdf.pdf}]
When I run it non-headless locally It is fine. Also when I try to visit url while I am in email is is OK.
Do you have any idea how to solve this (I need to have screen of PDF attachment).
Thank you.