0

I am using Protractor for automation. I am unable to launch the application url in headless chrome on linux machine[gitlab pipeline]. I tried to print the user agent details using
await browser.executeScript("return navigator.userAgent;")

which results=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/94.0.4606.54 Safari/537.36. So I have set
chromeoptions = ["--headless", '--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/94.0.4606.54 Safari/537.36'];

enter image description here

still application url is blocked while automation

USER AGENT:- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36

Capabilities {
  map_: Map {
    'acceptInsecureCerts' => false,
    'browserName' => 'chrome',
    'browserVersion' => '94.0.4606.54',
    'chrome' => {
      chromedriverVersion: '94.0.4606.61 (418b78f5838ed0b1c69bb4e51ea0252171854915-refs/branch-heads/4606@{#1204})',
      userDataDir: '/tmp/.com.google.Chrome.oJ9IHj'
    },
    'goog:chromeOptions' => { debuggerAddress: 'localhost:41937' },
    'networkConnectionEnabled' => false,
    'pageLoadStrategy' => 'normal',
    'platformName' => 'linux',
    'proxy' => {},
    'setWindowRect' => true,
    'strictFileInteractability' => false,
    'timeouts' => { implicit: 0, pageLoad: 300000, script: 30000 },
    'unhandledPromptBehavior' => 'dismiss and notify',
    'webauthn:extension:credBlob' => true,
    'webauthn:extension:largeBlob' => true,
    'webauthn:virtualAuthenticators' => true,
    'webdriver.remote.sessionid' => 'dfc2b48d52fccc38f19c52e9d145c433'
  }
}
1
  • It looks like an authorization problem. Are you sure you can access the app from your Gitlab pipeline? The app might be behind a firewall, accessible only on a VPN etc.
    – pavelsaman
    Nov 30 '21 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.