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
Related
I just editied on the xpath.click option and now when I build my project there a crash at the same line where I just have updated my xpath(xpath: //span[normalize-space()='400 AED'])
Do i need to update that link with jenkins as well? Don't know what is wrong and also I am new to this CI thing. Also I am not using github its simple running as system , giving commands from cmd here is my console output.
Started by user admin
Running as SYSTEM
Building in workspace C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1
[TestProject1] $ cmd /c call C:\Users\WRP\AppData\Local\Temp\jenkins12274346789675918240.bat
C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1>c:
C:\ProgramData\Jenkins\.jenkins\workspace\TestProject1>cd C:\Users\WRP\eclipse-workspace\PracticeProject
C:\Users\WRP\eclipse-workspace\PracticeProject>mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.NewPractice.org:PracticeProject >-----------------
[INFO] Building PracticeProject 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # PracticeProject ---
[INFO] Deleting C:\Users\WRP\eclipse-workspace\PracticeProject\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # PracticeProject ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # PracticeProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # PracticeProject ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # PracticeProject ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\Users\WRP\eclipse-workspace\PracticeProject\target\test-classes
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[64,77] unmappable character (0x8F) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[76,76] unmappable character (0x81) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[93,78] unmappable character (0x81) for encoding windows-1252
[WARNING] /C:/Users/WRP/eclipse-workspace/PracticeProject/src/test/java/First_Test/Practice_Arabic.java:[132,96] unmappable character (0x81) for encoding windows-1252
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) # PracticeProject ---
[INFO] Using auto detected provider org.apache.maven.surefire.testng.TestNGProvider
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Starting ChromeDriver 103.0.5060.53 (a1711811edd74ff1cf2150f36ffa3b0dae40b17f-refs/branch-heads/5060#{#853}) on port 57471
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Jul 07, 2022 11:43:01 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected upstream dialect: W3C
Jul 07, 2022 11:43:01 AM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
INFO: Found exact CDP implementation for version 103
Test was executed
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 21.677 s <<< FAILURE! - in TestSuite
[ERROR] First_Test.Task_TestNG.CheckOutTest Time elapsed: 14.925 s <<< FAILURE!
org.openqa.selenium.ElementNotInteractableException:
element not interactable
(Session info: chrome=103.0.5060.66)
Build info: version: '4.3.0', revision: 'a4995e2c09*'
System info: host: 'AWAIS-PC', ip: '192.168.1.62', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.3.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [d1dba2b10bdcd5ea06a7bd7ca089ca76, clickElement {id=c2fe92b6-a331-4fcb-a17f-8ce91b5cd10b}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 103.0.5060.66, chrome: {chromedriverVersion: 103.0.5060.53 (a1711811edd7..., userDataDir: C:\Users\WRP\AppData\Local\...}, goog:chromeOptions: {debuggerAddress: localhost:52878}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:52878/devtoo..., se:cdpVersion: 103.0.5060.66, 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 (d1dba2b10bdcd5ea06a7bd7ca089ca76)] -> xpath: //span[normalize-space()='400 AED']]
Session ID: d1dba2b10bdcd5ea06a7bd7ca089ca76
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
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 First_Test.Task_TestNG.CheckOutTest(Task_TestNG.java:66)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:677)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:221)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:962)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:194)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:148)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.testng.TestRunner.privateRun(TestRunner.java:806)
at org.testng.TestRunner.run(TestRunner.java:601)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:433)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:427)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:387)
at org.testng.SuiteRunner.run(SuiteRunner.java:330)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1256)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1176)
at org.testng.TestNG.runSuites(TestNG.java:1099)
at org.testng.TestNG.run(TestNG.java:1067)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:324)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:74)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:123)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] Task_TestNG.CheckOutTest:66 ยป ElementNotInteractable element not interactable
(Session info: chrome=103.0.5060.66)
Build info: version: '4.3.0', revision: 'a4995e2c09*'
System info: host: 'AWAIS-PC', ip: '192.168.1.62', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.3.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [d1dba2b10bdcd5ea06a7bd7ca089ca76, clickElement {id=c2fe92b6-a331-4fcb-a17f-8ce91b5cd10b}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 103.0.5060.66, chrome: {chromedriverVersion: 103.0.5060.53 (a1711811edd7..., userDataDir: C:\Users\WRP\AppData\Local\...}, goog:chromeOptions: {debuggerAddress: localhost:52878}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:52878/devtoo..., se:cdpVersion: 103.0.5060.66, 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 (d1dba2b10bdcd5ea06a7bd7ca089ca76)] -> xpath: //span[normalize-space()='400 AED']]
Session ID: d1dba2b10bdcd5ea06a7bd7ca089ca76
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.810 s
[INFO] Finished at: 2022-07-07T11:43:21+05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project PracticeProject: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\WRP\eclipse-workspace\PracticeProject\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
As the element is successfully identified but raises:
org.openqa.selenium.ElementNotInteractableException
Ideally to click() on the element you need to induce WebDriverWait for the elementToBeClickable() and you can use either of the following solutions:
Using xpath and normalize-space():
new WebDriverWait(driver, Duration.ofSeconds(10)).until(ExpectedConditions.elementToBeClickable(By.xpath("//span[normalize-space()='400 AED']"))).click();
Using xpath and contains():
new WebDriverWait(driver, Duration.ofSeconds(10)).until(ExpectedConditions.elementToBeClickable(By.xpath("//span[contains(., '400 AED')]"))).click();
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
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.
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.
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();