Hi there,
I found another topic that mentions a similar issue with Chrome, of which one solution is to close the currently running Chrome window(s) either through Task Manager (Windows) or Acitvity Monitor (MacOS)
I know this. You have one or more Chrome browser opened manually before you start the test. Contention arises for the default user-data directory. Chrome browser is apparently designed very sensitive about the contention.
A quick work around is to close the Chrome browsers before you start the test. This way works, but very cumbersome.
Another work around is
The solution I came up with that has worked every time so far (15 tests currently) was to clone the profile to a location inside the project every time the program runs and then point selenium to that clone.
as quoted from https://stackoverflow.com/questions/50635087/how-to-open-a-chrome-profile-through-user-data-dir-argument-of-selenium
Here’s the link to said topic:
Hi,
I am trying to launch chrome with a specific profile. I already tried 2 methods. Adding the arguments via settings, and I tried adding the arguments on a script basis which was posted here. Open Browser with Custom Profile
I am opening successfull chrome on my profile. But afterwards I get the error. I am using up to date chrome, chromedriver and Katalon Studio. Anyone tips on what causes the error, I can´t find any way to fix it.
org.openqa.selenium.InvalidArgumentException: invalid arg…
Let us know if this works for you