0

I am trying to run my Protractor test on a remote server (selenium grid). I have Jenkin job to execute commands. When I run the exact test on my local server, the browser (both Firefox and Chrome works) get starts and load the URL and complete the tests. But when I execute via Jenkins it starts the browser but does not load the URLs. After some time Jenkins job gets timed out but still, browsers are open and do nothing. any idea? help much appreciated

I am passing the remote server as follows in my config.js,

seleniumAddress:http://citest-grid.com:4444/wd/hub

Wicky
  • 118
  • 2
  • 13
  • Please share the Jenkin Code with us where you are loading URL – akshay patil Jan 18 '19 at 04:13
  • 1
    Double check the webdriver binary is compatible with the browser on the node of selenium grid. And confirm you explicitly specify the downloaded webdriver binary path in register cmd as following. `java -Dwebdriver.chrome.driver=C:/eclipse/chromedriver/chromedriver.exe -jar selenium-server-standalone-2.48.2.jar -port 5556 -role node -hub http://localhost:4444/grid/register -browser "browserName=chrome, version=ANY, maxInstances=10, platform=ANY"` More detail: https://developers.perfectomobile.com/pages/viewpage.action?pageId=21435360 – yong Jan 18 '19 at 08:29
  • @akshaypatil, I have 3 stages, 1. check out the branch 2. npm install 3 the cmd I am running to start the test is ``` npm run e2e -- --tags=@api ``` – Wicky Jan 20 '19 at 20:44
  • @yong I did exactly what you suggested, but same issue – Wicky Jan 20 '19 at 20:53
  • I have similar problem too: https://stackoverflow.com/questions/54204420/protractor-works-well-on-localhost-but-remote-throws-timeout-async-callback – Justinas Jakavonis Jan 23 '19 at 12:20

2 Answers2

1

I managed to solve this issue removing 'disable-infobars' in the chromeOptions. But not sure why

'chromeOptions': { 'args': ['disable-infobars'] }

Wicky
  • 118
  • 2
  • 13
0

Check with the below code

capabilities: {
    browserName: 'chrome',
    directConnect: true //Hope by adding this your problem gets resolved
  }

Remove seleniumAddress from your config.

Madhan Raj
  • 1,404
  • 1
  • 7
  • 13
  • if I remove the seleniumAddress then it's talking to localhost right? directConnect: true is working for local , Thx – Wicky Jan 20 '19 at 20:56
  • but if I add directConnect: true and run remotely again same results and getting following error ````[chrome #01-0] [21:51:14] I/direct - Using ChromeDriver directly... [chrome #01-0] [chrome #01-0] /var/lib/jenkins/workspace/test-ui-auto-qa/node_modules/selenium-webdriver/lib/error.js:546 [chrome #01-0] throw new ctor(message); [chrome #01-0] ^ [chrome #01-0] WebDriverError: unknown error: Chrome failed to start: exited abnormally```` – Wicky Jan 20 '19 at 21:50
  • @user8267843 refer – Madhan Raj Jan 21 '19 at 09:00