Running Chrome in headless mode for karate tests

599 views
Skip to first unread message

Clay, Sam

unread,
Jul 25, 2021, 11:43:26 AM7/25/21
to headle...@chromium.org

Hi

 

I’ve been struggling to find a way to run google chrome in headless mode to work with my test framework.

 

On a mac, I can run 

 

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 > /dev/null &

 

However I need the terminal session back, in order to continue with the next test.

 

We basically added chrome to our Jenkins build agent so that we could have the ability to run some karate tests in sequential order – so im testing this on my macbook so that I can get it working on our Jenkins build agent.

 

I can get chrome headless communicating with my tests but I’m wondering if I may have missed some command line arguments.. because it communicates with port 9222 the first test but every test after that, uses a new port like 38656 or similar.

Thanks

 

Samuel Clay

DevOps Engineer

UK ATC - Newcastle

Accenture Delivery

(Mob: 07766316319

* samue...@accenture.com

 

 

Is there any documentation on any more available command line arguments ‘–example’ that could help me?

 

Thanks

Sam

 




This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. Your privacy is important to us. Accenture uses your personal data only in compliance with data protection laws. For further information on how Accenture processes your personal data, please see our privacy statement at https://www.accenture.com/us-en/privacy-policy.
______________________________________________________________________________________

www.accenture.com

ziggy

unread,
Jul 28, 2021, 12:48:25 AM7/28/21
to headless-dev, Clay, Sam
I am not an expert but it looks like port 9222 is still being used by the first Chrome  instance.
Are running new Chrome instance with every new test ?
Reply all
Reply to author
Forward
0 new messages