1

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:

  1. I am logged in email account

  2. I go to email detail

  3. Email has PDF attachment with url.

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

Radim Bukovský
  • 337
  • 2
  • 11
  • no I have no idea and I am not surprised it doesn't work in headless mode, there will be limitations. I suggest you drop this use-case and move on to others, all the best – Peter Thomas Jun 30 '21 at 13:40

0 Answers0