Regarding integration of Selenium Java with AWS Lambda using headless chrome

43 views
Skip to first unread message

Radhika Joshi

unread,
Jul 1, 2020, 7:10:23 AM7/1/20
to seleniu...@googlegroups.com
Hi team ,
I am writing a script to automate my selenium java project with AWS Lambda using headless chrome.

Can someone guide me on the configurations of Google chrome in order to run it on chrome?

Thanks & Regards,
Radhika Joshi

Shawn McCarthy

unread,
Jul 2, 2020, 3:28:49 PM7/2/20
to Selenium Users
I use these flags :
flags = [
'--disable-background-timer-throttling',
'--disable-breakpad',
'--disable-client-side-phishing-detection',
'--disable-cloud-import',
'--disable-default-apps',
'--disable-dev-shm-usage', # I don't know if newer versions of Chromium accept this flag
'--disable-extensions',
'--disable-gesture-typing',
'--disable-hang-monitor',
'--disable-infobars',
'--disable-notifications',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-offer-upload-credit-cards',
'--disable-popup-blocking',
'--disable-print-preview',
'--disable-prompt-on-repost',
'--disable-setuid-sandbox',
'--disable-speech-api',
'--disable-sync',
'--disable-tab-for-desktop-share',
'--disable-translate',
'--disable-voice-input',
'--disable-wake-on-wifi',
'--enable-async-dns',
'--enable-simple-cache-backend',
'--enable-tcp-fast-open',
'--disable-webgl',
'--hide-scrollbars',
'--ignore-gpu-blacklist',
'--media-cache-size=33554432',
'--metrics-recording-only',
'--mute-audio',
'--no-default-browser-check',
'--no-first-run',
'--no-pings',
'--no-sandbox',
'--no-zygote',
'--password-store=basic',
'--prerender-from-omnibox=disabled',
# '--use-gl=swiftshader', # Used for webgl. Turn --disable-webgl to --enablew-webgl
'--use-mock-keychain',
'--single-process',
'--headless',
'--disable-gpu',
'--user-data-dir=/tmp/user-data',
'--data-path=/tmp/data-path',
'--homedir=/tmp',
'--disk-cache-dir=/tmp/cache-dir',
'--remote-debugging-port=9222',
"--window-size=#{ENV['RESOLUTION']}"
]

Then I create the driver via :
options = Selenium::WebDriver::Chrome::Options.new(args: flags, binary: '/tmp/chrome')
caps = desired_capabilities
@driver = Selenium::WebDriver.for(
caps[:browser_name].to_sym,
desired_capabilities: caps,
options: options
)

I put Chrome and Chromedriver in /tmp

Radhika Joshi

unread,
Jul 3, 2020, 2:07:17 AM7/3/20
to seleniu...@googlegroups.com
Hi 

what is binary: '/tmp/chrome' .You mentioned that you stored the chromedriver in /tmp?  Can we store it anywhere or do we need to store it in a particular location only?
Also, do we need to integrate selenium with linux for the same?

Thanks & Regards
Radhika Joshi

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0551b5f0-c40f-41ba-a7b6-659097549b34n%40googlegroups.com.

Shawn McCarthy

unread,
Jul 3, 2020, 3:44:39 PM7/3/20
to Selenium Users
In AWS Lambda, not every directory is writeable. I know for a fact /tmp IS writeable, so I put it there.

/tmp/chrome is the chrome binary . You can probably get chrome from https://github.com/alixaxel/chrome-aws-lambda/tree/master/bin

Here are some more projects I found helpful :

bharath kumar

unread,
Jul 14, 2020, 3:25:34 AM7/14/20
to seleniu...@googlegroups.com
Hi,
Product is good. It fulfills what it is meant for.
Thanks again!

--
Reply all
Reply to author
Forward
0 new messages