Selenium/Fitnesse loses session during test ( - selenium

I'm using Fitnesse to create tests. When I run them in de webbased tool they succeed. When run via Microsoft Visual Studio Team Foundation Server I get the following error, although sometimes it seems to run normal at the same point but in a different testcase.
org.openqa.selenium.WebDriverException: Unable to execute request for an existing session: Unable to find session with ID: <session-id>
Build info: version: '4.1.3', revision: '7b1ebf28ef'
System info: host: 'G-WPTAPP-01', ip: '<ip>', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '12.0.1'
Driver info: driver.version: unknown
Build info: version: '4.1.2', revision: '9a5a329c5a'
System info: host: 'G-WPTAPP-01', ip: '<ip>', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '12.0.1'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [<session-id>, findElements {using=css selector, value=#mask}]
Capabilities {acceptInsecureCerts: false, browserName: msedge, browserVersion: 102.0.1245.44, javascriptEnabled: true, ms:edgeOptions: {debuggerAddress: localhost:64446}, msedge: {msedgedriverVersion: 102.0.1245.44 (72efbf98e0b4..., userDataDir: D:\Users\svc_g-wptapp-01\Ap...}, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://<ip>:4444/sessi..., se:cdpVersion: 102.0.1245.44, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: ignore, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: <session-id>
I have already tried updating the edgedriver and extending the grid session-timeout but it doesn't seem to help.

Related

Test automation Error during script execution on page https://xxx.xxxx.fr/ SecurityError: The operation is insecure. Build info: version: 'unknown

how to make "network.websocket.allowInsecureFromHTTPS" true?
I have firefox installed on the openstack cloud VM and when i run the test i have this
Error during script execution on page https://...fr/ SecurityError: The operation is insecure. Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'tanaguru', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-52-generic', java.version: '11.0.17' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 102.4.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20221010114559, moz:geckodriverVersion: 0.32.0, moz:headless: true, moz:processID: 516150, moz:profile: /tmp/rust_mozprofileiUzVeb, moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 5.15.0-52-generic, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: b97f16bc-d5ee-4cb2-8fc7-1f54efcf585c
I install the certificat but I still have the same problem

Exception in thread "main" org.openqa.selenium.InvalidArgumentException: invalid argument

I am getting the following error after running the code:
Exception in thread "main" org.openqa.selenium.InvalidArgumentException: invalid argument
(Session info: chrome=103.0.5060.114)
Build info: version: '4.3.0', revision: 'a4995e2c09*'
System info: host: 'SADAF-RAUF', ip: '192.168.1.55', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.15'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [99bdbf5c25fd5790a4c9901c3f7f1dde, clickElement {id=1d9cbee0-b4cb-4993-b271-3a3e36c42165}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 103.0.5060.114, chrome: {chromedriverVersion: 103.0.5060.53 (a1711811edd7..., userDataDir: C:\Users\Sadaf\AppData\Loca...}, goog:chromeOptions: {debuggerAddress: localhost:64336}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:64336/devtoo..., se:cdpVersion: 103.0.5060.114, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Element: [[ChromeDriver: chrome on WINDOWS (99bdbf5c25fd5790a4c9901c3f7f1dde)] -> id: uploadPicture]
Session ID: 99bdbf5c25fd5790a4c9901c3f7f1dde
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:53)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:569)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:257)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:78)
at com.autoit.FileUpload.upload(FileUpload.java:25)
at com.autoit.FileUpload.main(FileUpload.java:32)code image
//use Sendkeys
driver.findElement(By.id("uploadPicture")).sendKeys("L:\Software\wrar511b1.exe");

selenium.WebDriverException: unknown error: session deleted because of page crash from tab crashed

Note: My question was closed earlier, I tried solutions mentioned here - unknown error: session deleted because of page crash from unknown error: cannot determine loading status from tab crashed with ChromeDriver Selenium -- added these options - options.addArguments("--disable-dev-shm-usage"); options.addArguments("--no-sandbox"); -- Still I see the issue
Seeing below errors for single test in some scenarios in between when running in selenium grid:
Hooks method1:
org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from tab crashed
(Session info: chrome=80.0.3987.106)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-37JVVAA', ip: '169.254.210.134', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 80.0.3987.106, chrome: {chromedriverVersion: 80.0.3987.106 (f68069574609..., userDataDir: /tmp/.com.google.Chrome.TQ7Z9v}, goog:chromeOptions: {debuggerAddress: localhost:41695}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: none, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: 2ac66b1a001b0b8c6c24da9821b...}
Session ID: 2ac66b1a001b0b8c6c24da9821b8f1e2
Hooksmethod2:
org.openqa.selenium.NoSuchSessionException: invalid session id
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-37JVVAA', ip: '169.254.210.134', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 80.0.3987.106, chrome: {chromedriverVersion: 80.0.3987.106 (f68069574609..., userDataDir: /tmp/.com.google.Chrome.TQ7Z9v}, goog:chromeOptions: {debuggerAddress: localhost:41695}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: none, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: 2ac66b1a001b0b8c6c24da9821b...}
Session ID: 2ac66b1a001b0b8c6c24da9821b8f1e2
Hooksmethod3:
org.openqa.selenium.WebDriverException: Session [2ac66b1a001b0b8c6c24da9821b8f1e2] was terminated due to BROWSER_TIMEOUT
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-37JVVAA', ip: '169.254.210.134', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 80.0.3987.106, chrome: {chromedriverVersion: 80.0.3987.106 (f68069574609..., userDataDir: /tmp/.com.google.Chrome.TQ7Z9v}, goog:chromeOptions: {debuggerAddress: localhost:41695}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: none, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webdriver.remote.sessionid: 2ac66b1a001b0b8c6c24da9821b...}
Session ID: 2ac66b1a001b0b8c6c24da9821b8f1e2
We have 3 sequential methods in hooks - looks like first issue is the root cause, but am not sure.
Following are the options used for driver:
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized");
options.addArguments("--disable-infobars");
options.addArguments("--disable-extensions");
options.addArguments("chrome.switches", "--disable-extensions");
options.addArguments("--disable-gpu");
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--no-sandbox");
options.addArguments("--disable-notifications");
options.addArguments("--disable-popup-blocking");
options.addArguments("enable-automation");
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--disable-browser-side-navigation");
options.addArguments("--dns-prefetch-disable");
options.setPageLoadStrategy(PageLoadStrategy.NONE);
options.setExperimentalOption("useAutomationExtension", false);
driver = new RemoteWebDriver(new URL(AWS_URL), options);
Following are the overrides we used in kubernetest yaml file:
chrome:
## Enable the creation of a node-chrome pod
enabled: true
replicas: 65
javaOpts: "-Xmx1024m -XX:+UseSerialGC"
resources:
limits:
cpu: ".5"
memory: "1000Mi"
env:
sessionTimeout: 60
hub:
env:
sessionTimeout: 60
##gridBrowserTimeout
gridBrowserTimeout: 240
livenessTimeout: 15
readinessTimeout: 15
gridJettyMaxThreads: 1024
gridTimeout: 60
gridCleanUpCycle: 5000
gridNewSessionWaitTimeout: -1
javaOpts: "-Xmx1024m -XX:+UseSerialGC"
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
resources:
limits:
cpu: "3"
memory: "2048Mi"
Please help
I had the same issue and it was resolved by adding the -/dev/shm:/dev/shm for the chrome container in the docker-compose.yml file
Refer: https://github.com/SeleniumHQ/docker-selenium
chrome:
image: selenium/node-chrome
depends_on:
- selenium-hub
volumes:
- /dev/shm:/dev/shm
environment:
HUB_PORT_4444_TCP_ADDR: selenium-hub
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_SESSION: 2
NODE_MAX_INSTANCES: 2
I had the same issue for Chrome and Firefox. I was able to resolve it by increasing the size (shm_size) of both containers.
version: "3"
services:
hub:
image: selenium/hub
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome
shm_size: '1gb'
depends_on:
- hub
environment:
- HUB_HOST=hub
firefox:
image: selenium/node-firefox
shm_size: '1gb'
depends_on:
- hub
environment:
- HUB_HOST=hub

Hover is not working in selenium test for Windows 8.1 and Firefox 60.4 combination

Hover is not working in selenium test for Windows 8.1 and Firefox 60.4 combination code is right its working fine with linux OS with same firefox version
I have tried it with Linux with same firefox version
System info: host: 'PWDCSV-W81N14', ip: '10.232.247.174', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_221'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 60.4.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.26.0, moz:headless: false, moz:processID: 11060, moz:profile: C:\Temp\rust_mozprofileHY1rIp, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.3, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
this is the error logs
Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for com.ptc.selenium.SolventSelenium$9#67b174b9 (tried for 180 second(s) with 500 milliseconds interval)with build info as above

Getting TimeOutException in selenium due to this unable to switch to third window in IE

Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out
waiting for page to load.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-
14T08:25:48'
System info: host: 'INGGNED89DP882', ip: '10.197.131.45', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities {acceptInsecureCerts: false, browserName: internet explorer,
browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal,
platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions:
{browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover:
true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: true,
ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false,
ignoreProtectedModeSettings: true, ignoreZoomSetting: false, initialBrowserUrl:
http://localhost:46027/, nativeEvents: true, requireWindowFocus: false},
setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: 908d30d6-dc3f-4ac8-a1ca-1ddfc060b716
Getting above exception in Internet Explorer Windows 10 , java.version: '1.8.0_60'
try to use the explicit wait based on the condition
WebDriverWait wait = new WebDriverwait(driver,30);
wait.Until(ExpectedCondtions.VisibilityofemementlocatedBy(yourxpath));