admin管理员组文章数量:1317894
Chrome instance not getting started for selenium testing in github runner.
.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
The exception is : .openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
Host info: host: 'road-runner-os023-m-nwx', ip: 'xxx'
Build info: version: '4.23.0', revision: '4df0a231af'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.19.0-41-generic', java.version: '17.0.14'
Driver info: .openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-certificate-errors, --no-sandbox, --disable-dev-shm-usage, --user-data-dir=/tmp/chrome..., --disable-setuid-sandbox, --no-zygote, --start-maximized, --window-size=1920,1080, --headless=old, --disable-gpu, --window-size=1920,1080, --start-maximized], binary: /usr/bin/google-chrome, excludeSwitches: [enable-automation], extensions: [], prefs: {credentials_enable_service: false, profile.password_manager_enabled: false}, useAutomationExtension: false}}]}]
Attempted solution(didnt work):
options.addArguments("--user-data-dir=/tmp/chrome-user-data-dir");
run: |
export USER_DATA_DIR="/tmp/chrome-user-data-dir"
mkdir -p "$USER_DATA_DIR"
echo "USER_DATA_DIR=$USER_DATA_DIR" >> $GITHUB_ENV
Using below to start chrome session
driver = new ChromeDriver(options);
Chrome instance not getting started for selenium testing in github runner.
.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
The exception is : .openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
Host info: host: 'road-runner-os023-m-nwx', ip: 'xxx'
Build info: version: '4.23.0', revision: '4df0a231af'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.19.0-41-generic', java.version: '17.0.14'
Driver info: .openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-certificate-errors, --no-sandbox, --disable-dev-shm-usage, --user-data-dir=/tmp/chrome..., --disable-setuid-sandbox, --no-zygote, --start-maximized, --window-size=1920,1080, --headless=old, --disable-gpu, --window-size=1920,1080, --start-maximized], binary: /usr/bin/google-chrome, excludeSwitches: [enable-automation], extensions: [], prefs: {credentials_enable_service: false, profile.password_manager_enabled: false}, useAutomationExtension: false}}]}]
Attempted solution(didnt work):
options.addArguments("--user-data-dir=/tmp/chrome-user-data-dir");
run: |
export USER_DATA_DIR="/tmp/chrome-user-data-dir"
mkdir -p "$USER_DATA_DIR"
echo "USER_DATA_DIR=$USER_DATA_DIR" >> $GITHUB_ENV
Using below to start chrome session
driver = new ChromeDriver(options);
Share Improve this question asked Jan 22 at 15:32 AmreshAmresh 3831 gold badge6 silver badges16 bronze badges 4- try without setting the user-data-dir. It'll automatically create a temporary profile for use. If that fails, it's probably a permissions issue. – browsermator Commented Jan 22 at 20:06
- Thanks for reply. Yes it was earlier setting without use of user-data-dir. It returned the same error. Hence posted the query here.. – Amresh Commented Jan 23 at 3:34
- I believe its related to this github/actions/runner-images/issues/10636 – Keith Commented Jan 23 at 18:35
- @Keith, Please try using headless with chromeoptions. – Amresh Commented Jan 23 at 18:46
1 Answer
Reset to default 2I am able to resolve by setting headless mode. Earlier I used headless=old.
Just simple setting
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--headless");
WebDriver driver = new ChromeDriver(chromeOptions);
本文标签:
版权声明:本文标题:selenium webdriver - Github actions runner : Chrome SessionNotCreatedException - user data directory is already in use - Stack O 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742036054a2417299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论