I executed selenium code but an error is appearing - java

Using this script but an error message appears.
WebElement elecounty = (driver.findElement(By.xpath("//div[#class='select_county']//span[text()='select'] ")));
//Thread.sleep(5000);
elecounty.click();Thread.sleep(5000);
elecounty.sendKeys("Baker");
Error message:
element not interactable
(Session info: chrome=75.0.3770.142)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'NAV-L186', ip: '192.168.0.186', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_212'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 75.0.3770.142, chrome: {chromedriverVersion: 75.0.3770.90 (a6dcaf7e3ec6f..., userDataDir: ...}, goog:chromeOptions: {debuggerAddress: localhost:58326}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: d287681e8c023df5adc766bffc9d5b15

ElementNotInteractableException is thrown to indicate that although an element is present with in the HTML DOM, it is not in a state that can be interacted with.
You should use WebDriverWait with ExpectedCondition.elementToBeClickable:
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement elecounty = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[#class='select_county']//span[text()='select']")));
elecounty.click();

Related

Not able to generate cucumber report basically the mail execution fails

I am not able to generate the email of the cucumber report, it was working fine a few days ago but now it throws the following error
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (mail-execution) on project qa-automation: An exception occured while executing the Java class. no such element: Unable to locate element: {"method":"xpath","selector":"//*[#id="featureChartCarousel"]/ol/li[1]"}
[ERROR] (Session info: headless chrome=108.0.5359.124)
[ERROR] For documentation on this error, please visit: https://selenium.dev/exceptions/#no_such_element
[ERROR] Build info: version: '4.1.2', revision: '9a5a329c5a'
[ERROR] System info: host: 'ip-10-0-1-80', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-1092-aws', java.version: '1.8.0_352'
[ERROR] Driver info: org.openqa.selenium.chrome.ChromeDriver
[ERROR] Command: [f0b38831845245c963309f6da8c906c1, findElement {using=xpath, value=//*[#id="featureChartCarousel"]/ol/li[1]}]
[ERROR] Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 108.0.5359.124, chrome: {chromedriverVersion: 108.0.5359.71 (1e0e3868ee06..., userDataDir: /tmp/.com.google.Chrome.WmdU7j}, goog:chromeOptions: {debuggerAddress: localhost:32925}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: ws://localhost:32925/devtoo..., se:cdpVersion: 108.0.5359.124, 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}
[ERROR] Session ID: f0b38831845245c963309f6da8c906c1
I checked the XPath is fine but the mail is not getting triggered I think the report is not getting generated

Error: New app path did not have extension .apk

Trying to learn Appium and run in some issues that I can't really figure out when running Maven Project and wanted to see if I could execute the java application.
When executing the Java application it complains about the apk file. The apk file is in the "src" folder (see attached image) and I have entered correct path.
Original error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
******MY CODE:******
public class main {
public static AndroidDriver<AndroidElement> Capabilities(String appName) throws IOException {
// System.getProperty("user.dir");
FileInputStream fis = new FileInputStream(System.getProperty("user.dir") + "\\src\\main\\java\\practise\\AppiumFramework\\global.properties");
Properties prop = new Properties();
prop.load(fis);
AndroidDriver<AndroidElement> driver;
File appDir = new File("src");
File app = new File(appDir, (String) prop.get(appName));
DesiredCapabilities cap = new DesiredCapabilities();
String device = (String) prop.get("device");
cap.setCapability(MobileCapabilityType.DEVICE_NAME,"device");
cap.setCapability(MobileCapabilityType.AUTOMATION_NAME,"uiautomator2");
cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 14);
cap.setCapability(MobileCapabilityType.APP, appDir.getAbsolutePath());
driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
return driver;
}
}
**CONSOLE OUTPUT**:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'LAPTOP-PDE95IER', ip: '192.168.1.24', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.2'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
at getResponseForW3CError (C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'LAPTOP-PDE95IER', ip: '192.168.1.24', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.2'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:95)
at practise.AppiumFramework.main.Capabilities(main.java:37)
at practise.AppiumFramework.ecommerc_tc_4.main(ecommerc_tc_4.java:18)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
... 14 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'LAPTOP-PDE95IER', ip: '192.168.1.24', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.2'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
at getResponseForW3CError (C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
**APPIUM LOG:**
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src","automationName":"uiautomator2","platformName":"Android","deviceName":"device","newCommandTimeout":14},"capabilities":{"firstMatch":[{"appium:app":"C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src","appium:automationName":"uiautomator2","appium:deviceName":"device","appium:newCommandTimeout":14,"platformName":"android"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src","automationName":"uiautomator2","platformName":"Android","deviceName":"device","newCommandTimeout":14},null,{"firstMatch":[{"appium:app":"C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src","appium:automationName":"uiautomator2","appium:deviceName":"device","appium:newCommandTimeout":14,"platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1614346210971 (14:30:10 GMT+0100 (centraleuropeisk normaltid))
[Appium] Appium v1.20.2 creating new AndroidUiautomator2Driver (v1.61.2) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver] "alwaysMatch": {
[debug] [BaseDriver] "platformName": "android",
[debug] [BaseDriver] "appium:app": "C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src",
[debug] [BaseDriver] "appium:automationName": "uiautomator2",
[debug] [BaseDriver] "appium:deviceName": "device",
[debug] [BaseDriver] "appium:newCommandTimeout": 14
[debug] [BaseDriver] },
[debug] [BaseDriver] "firstMatch": [
[debug] [BaseDriver] {}
[debug] [BaseDriver] ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 210de100-ae52-494e-9efd-b449c93d0142
[BaseDriver] Using local app 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src'
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1614346210995 (14:30:10 GMT+0100 (centraleuropeisk normaltid))
[debug] [W3C] Encountered internal error running command: Error: New app path 'C:\Users\Elvedin\eclipse-workspace\AppiumFramework\src' did not have extensions: .apk,.apks
[debug] [W3C] at verifyAppExtension (C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\helpers.js:120:9)
[debug] [W3C] at C:\Users\Elvedin\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\helpers.js:269:5
[HTTP] <-- POST /wd/hub/session 500 30 ms - 785
[HTTP]
[Appium] Received SIGINT - shutting down
[debug] [Appium] There are no active sessions for cleanup
[HTTP] Waiting until the server is closed
[HTTP] Received server close event
src path folder
main class
ecommerce_tc_4 class
global.properties file
check capabilities in documentation. Specify with app - absolute path to .apk file: /abs/path/to/my.apk. There are no specified .apk file in your code: C:\\Users\\Elvedin\\eclipse-workspace\\AppiumFramework\\src

Selenium/TestBench failure: net::ERR_CONNECTION_REFUSED

I tried to run the web application and launch it using google chrome but it shows an error and this is the exception that im getting. Im new to web development and i dont have experience on web development. This is fully following from vaadin tutorial and still im getting such error.
I hope someone can explain the problem here and the solution.
12:18:42.557 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\Abyss\.m2\repository\webdriver\chromedriver\win32\85.0.4183.87\chromedriver.exe
Sep 18, 2020 12:18:42 PM com.vaadin.testbench.parallel.ParallelTest setup
INFO: Did not find a configuration to run locally, on Sauce Labs or on other test grid. Falling back to running locally on Chrome.
Starting ChromeDriver 85.0.4183.87 (cd6713ebf92fa1cacc0f1a598df280093af0c5d7-refs/branch-heads/4183#{#1689}) on port 14652
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Sep 18, 2020 12:18:46 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javassist.util.proxy.SecurityActions (file:/C:/Users/Abyss/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.SecurityActions
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sep 18, 2020 12:18:52 PM com.vaadin.testbench.ScreenshotOnFailureRule failed
INFO: Error screenshot written to: C:\Users\Abyss\Documents\Intellij Prgram\vaadin-crm\vaadin-crm\error-screenshots\loginAsValidUserSucceeds[ANY_Chrome_](com.vaadin.tutorial.crm.it.LoginIT).png
org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_REFUSED
(Session info: chrome=85.0.4183.102)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-UIL9GAM', ip: '192.168.0.22', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.8'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 85.0.4183.102, chrome: {chromedriverVersion: 85.0.4183.87 (cd6713ebf92fa..., userDataDir: C:\Users\Abyss\AppData\Loca...}, goog:chromeOptions: {debuggerAddress: localhost:58803}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: de2db382831034a569b4913b37583b71
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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:277)
at com.vaadin.testbench.TestBenchDriverProxy.get(TestBenchDriverProxy.java:66)
at com.vaadin.testbench.TestBenchDriverProxy_$$_jvste97_0._d24get(TestBenchDriverProxy_$$_jvste97_0.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.vaadin.testbench.DriverInvocationHandler.invoke(DriverInvocationHandler.java:51)
at com.vaadin.testbench.TestBenchDriverProxy_$$_jvste97_0.get(TestBenchDriverProxy_$$_jvste97_0.java)
at com.vaadin.tutorial.crm.it.AbstractTest.setup(AbstractTest.java:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at com.vaadin.testbench.parallel.ParallelRunner$1.evaluate(ParallelRunner.java:468)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at com.vaadin.testbench.parallel.ParallelScheduler$1.call(ParallelScheduler.java:48)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()?
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-UIL9GAM', ip: '192.168.0.22', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.8'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:125)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:489)
at com.vaadin.testbench.commands.TestBenchCommandExecutor.waitForVaadin(TestBenchCommandExecutor.java:127)
at com.vaadin.testbench.DriverInvocationHandler.waitForVaadinIfNecessary(DriverInvocationHandler.java:69)
at com.vaadin.testbench.DriverInvocationHandler.invoke(DriverInvocationHandler.java:37)
at com.vaadin.testbench.TestBenchDriverProxy_$$_jvste97_0.getScreenshotAs(TestBenchDriverProxy_$$_jvste97_0.java)
at com.vaadin.testbench.ScreenshotOnFailureRule.failed(ScreenshotOnFailureRule.java:113)
at org.junit.rules.TestWatcher.failedQuietly(TestWatcher.java:90)
at org.junit.rules.TestWatcher.access$300(TestWatcher.java:52)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:68)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at com.vaadin.testbench.parallel.ParallelScheduler$1.call(ParallelScheduler.java:48)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Process finished with exit code -1
I don't think the error is related to the illegal reflective access warning.
Is your application running? TestBench requires your application to run while executing tests.

Driver info: driver.version: unknown using ChromeDriver v78.0.3904.70 and Chrome browser v78.0.3904.97

I am using java 1.8 with chrome browser version 78.0.3904.97. I am trying to execute my selenium script code with the chrome driver version 78.0.3904.70. but while execution I am facing below issue and chrome crases immediately
Picked up JAVA_TOOL_OPTIONS: -Djdk.http.auth.tunneling.disabledSchemes=""
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
If you check the below logs then you will get to know that I am passing 78.0.3904.70 version of chrome driver and trying to launch 78.0.3904.97 chrome browser which is creating an issue. Also if you check https://chromedriver.chromium.org/downloads link then you will get to know 78.0.3904.97 version of chrome driver is not available
Error Log
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904#{#800}) on port 22844
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Nov 18, 2019 12:06:32 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
12:06:32.350 [main] DEBUG net.serenitybdd.core.photography.Darkroom - Opening darkroom
12:06:32.360 [Darkroom Processing Line] DEBUG net.serenitybdd.core.photography.DarkroomProcessingLine - Darkroom processing line starting up
12:06:33.613 [main] DEBUG net.serenitybdd.core.photography.Darkroom - Send negative for processing for target\site\serenity\c5e0d5f762dd0408b347b1b56ece2682cce0d422c500276e3f33c78c87fadcf6.png
12:06:35.280 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener -
12:06:35.825 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - TEST FAILED AT STEP Launch browser and navigate to URL
12:06:35.825 [main] ERROR net.thucydides.core.steps.ConsoleLoggingListener - invalid argument
org.openqa.selenium.remote.UnreachableBrowserException: invalid argument
(Session info: chrome=78.0.3904.97)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: C:\Users\DIPAK~1.BAC\AppDat...}, goog:chromeOptions: {debuggerAddress: localhost:52359}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 22ece16d3a54371674e778dca702876b
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: unknown
at webapplication.contactlenses.pages.Homepage.navigateToBaseUrlNL(Homepage.java:530)
at webapplication.contactlenses.steplib.ContactLensSteplib.navigate_to_baseUrlNL(ContactLensSteplib.java:28)
at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70.CGLIB$navigate_to_baseUrlNL$16(<generated>)
at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70$$FastClassByCGLIB$$c8d6c80f.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:461)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:446)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:421)
at net.thucydides.core.steps.StepInterceptor.runOrSkipMethod(StepInterceptor.java:176)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:163)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:69)
at webapplication.contactlenses.steplib.ContactLensSteplib$$EnhancerByCGLIB$$916d3a70.navigate_to_baseUrlNL(<generated>)
I have already checked for chrome driver version 78.0.3904.97 but it's not available. Can someone please guide me to resolve this issue.
Chromedriver version should be shown in logs
Driver info: driver.version: unknown
Are you setting the correct path to chromedriver.exe. Verify it.
System.setProperty("webdriver.chrome.driver", "C:/PathToChromeDriver/chromedriver.exe");
This error message...
org.openqa.selenium.remote.UnreachableBrowserException: invalid argument
(Session info: chrome=78.0.3904.97)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 78.0.3904.70 (edb9c9f3de024..., userDataDir: C:\Users\DIPAK~1.BAC\AppDat...}, goog:chromeOptions: {debuggerAddress: localhost:52359}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 22ece16d3a54371674e778dca702876b
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'UKF6-L015064', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: unknown
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Though you are using chromedriver=78.0.3904.97
And you are also using chrome=78.0.3904.97
Your Selenium Client version is also 3.141.59.
Your JDK version is 1.8.0_131 which is pretty ancient.
So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.141.59 , ChromeDriver v78.0.3904.97 and the Chrome Browser v78.0.3904.97
Solution
Ensure that:
JDK is upgraded to current levels JDK 8u222.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.

Jenkins pipeline, Cucumber test step : Session deleted because of page crash from tab crashed

I am facing the issue. When I try to build my Jenkins pipeline, there is one test step which always fails. Note: When I build Docker image on swarm mode, locally it works as expected and there are not any failure tests. I use chrome=56.0.2924.87, chromedriver=2.27.440175, selenium/hub: 3.0.1, os.name: 'Linux'(on Windows ok)
#When("^I want to preview customizations$")
#DescribedAs("I want to preview customizations")
public void previewCustomizations(){
final String idButton="previewCustomization";
commonDefinition.getBrowsers().execute(browser -> {
final WebElement webElement = browser.findElement(By.id(idButton))
.orElseThrow(() -> new CucumberException(String.format("Unable to find overview button by [%s] id", idButton)));
webElement.click();
});
}
Tests run: 26, Failures: 0, Errors: 2, Skipped: 7, Time elapsed: 0.003 sec <<< FAILURE! - in Scenario: XXXX
I want to preview customizations(Scenario: XXXX) Time elapsed: 0.003 sec <<< ERROR!
org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from tab crashed
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.10.0-514.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.74 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.21.1.el7.x86_64', java.version: '1.8.0_121'
org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from tab crashed
(Session info: chrome=56.0.2924.87)
(Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.10.0-514.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.74 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.21.1.el7.x86_64', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320), userDataDir=/tmp/.org.chromium.Chromium.70A1hR}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=56.0.2924.87, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=accept}]
Session ID: 1e439001dcab758d5e223feb8215ecc9
Command duration or timeout: 1.90 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.6.1.el7.x86_64', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320), userDataDir=/tmp/.org.chromium.Chromium.70A1hR}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=true, version=56.0.2924.87, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, webdriver.remote.sessionid=600786ad-3faa-49a9-b056-09acb1aec681, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=accept}]
Session ID: 600786ad-3faa-49a9-b056-09acb1aec681
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)

Categories