I’m able to run selenium on non GUI centos/linux machine in headless mode.
I have been trying to run it with cache enable by passing below chromeoptions arguments.
chromeOptions.addArguments("user-data-dir=~/.config/google-chrome");
It has started fine and identified elements till login page(which is first page) and couldn’t identify any locators after that.
Is it the right approach to run cache enabled selenium run?
2
Answers
It’s not that super clear when you mention about executing your tests with cache enabled. However, adding the argument
user-data-dir
is the canonical way to use a specific Chrome Profile.You can find a couple of detailed discussions in:
Adding those options helps me to prevent crashes and errors on a linux remote machine