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
Related
I have written scripts using appium java client and maven and i need to run the with circleCI
can anyone help me with this?
Below is the yml file I wrote but its not working for me
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk-node
- image: appium/appium-emulator
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
# run tests!
- run: mvn clean
- run: mvn test
workflows:
maven_test:
jobs:
- maven/test
here is the error it gave
Its showing the app is not present at given location but i have checked manually its there
is there a way to solve this?
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: Could not find app apk at /home/circleci/project/App/eezy-uat-2.apk (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 38.57 seconds Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: '8908ccb13df1', ip: '192.168.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1092-aws', java.version: '1.8.0_265' Driver info: driver.version: AndroidDriver Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: '8908ccb13df1', ip: '192.168.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1092-aws', java.version: '1.8.0_265' Driver info: driver.version: AndroidDriver
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: Could not find app apk at /home/circleci/project/App/app.apk (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38.57 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '8908ccb13df1', ip: '192.168.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1092-aws', java.version: '1.8.0_265'
Driver info: driver.version: AndroidDriver
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '8908ccb13df1', ip: '192.168.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1092-aws', java.version: '1.8.0_265'
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:41)
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 io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:88)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:98)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:94)
at com.eezy.generics.BaseTest.beforeMethod(BaseTest.java:132)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
... 42 more
Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find app apk at /home/circleci/project/App/app.apk (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 38.57 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '8908ccb13df1', ip: '192.168.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-1092-aws', java.version: '1.8.0_265'
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:531)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
... 47 more
... Removed 33 stack frames
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.
Encountered the following error. Cannot identify the exact root cause.
Error Message
Failed to connect to binary FirefoxBinary(/usr/lib64/firefox/firefox) on port 7055; process output follows:
Error: cannot open display: :99
Error: cannot open display: :99
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'nila.ejyothi.net', ip: '192.168.202.35', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.20.1.el7.x86_64', java.version: '1.7.0_91'
Driver info: driver.version: FirefoxDriver
Stacktrace
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/lib64/firefox/firefox) on port 7055; process output follows:
Error: cannot open display: :99
Error: cannot open display: :99
Build info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'
System info: host: 'nila.ejyothi.net', ip: '192.168.202.35', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-229.20.1.el7.x86_64', java.version: '1.7.0_91'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:130)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:182)
at com.fetchinglife.application.modules.utilities.CommonFunctions.initBrowser(CommonFunctions.java:74)
at com.fetchinglife.application.modules.employee.EmployeeScheduleFunctionalTest.StartBrowser_NavURL(EmployeeScheduleFunctionalTest.java:34)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: :99
Error: cannot open display: :99
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
This is likely to happen when Selenium webDriver API can't load Firefox driver.
Possible cause could be compatibility between Firefox version and Selenium server version.
Use the latest Selenium Server 2.51.0
I am getting the following error when I run this code in my automation suite,
Selenium 2.47.1
Internet Explorer 11
OS: Windows 8
WebDriver driver = new InternetExplorerDriver();
Exception Trace:
org.openqa.selenium.remote.UnreachableBrowserException: Could not
start a new session. Possible causes are invalid address of the remote
server or browser start-up failure. Build info: version: '2.47.1',
revision: 'unknown', time: '2015-07-30 11:02:44' System info: host:
os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2',
java.version: '1.7.0_51' Driver info: driver.version:
InternetExplorerDriver at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:589)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
at
org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:182)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:174)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:146)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting
for driver server to start. Build info: version: '2.47.1', revision:
'unknown', time: '2015-07-30 11:02:44' System info: host: os.name:
'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version:
'1.7.0_51' Driver info: driver.version: InternetExplorerDriver at
org.openqa.selenium.remote.service.DriverService.start(DriverService.java:170)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:63)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:227)
at
org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:182)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:174)
at
org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:146)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed
out waiting for [http://localhost:23905/status] to be available after
20005 ms at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at
org.openqa.selenium.remote.service.DriverService.start(DriverService.java:167)
... 50 more Caused by:
com.google.common.util.concurrent.UncheckedTimeoutException:
java.util.concurrent.TimeoutException at
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 51 more Caused by: java.util.concurrent.TimeoutException at
java.util.concurrent.FutureTask.get(FutureTask.java:201) at
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
... 52 more
I solved the problem by configuring the system property for the internet explorer driver,
System.setProperty("webdriver.ie.driver", "IEDriverServer.exe");
And changed the protected mode setting to be same for all the zones.
I'm having issues starting up the PhantomJS driver. It works just fine on my local machine (OSX) but I'm having issues getting it started on the server (Linux).
Here's the code that causes the issue:
DesiredCapabilities dcap = new DesiredCapabilities();
String[] phantomArgs = new String[] { "--webdriver-loglevel=NONE" };
dcap.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, phantomArgs);
dcap.setCapability("phantomjs.binary.path", "/usr/local/bin/phantomjs");
WebDriver driver = new PhantomJSDriver(dcap);
And here's the stack trace of the issue:
[ERROR] [09/09/2015 18:32:45.517] [pipeline-akka.actor.default-dispatcher-11] [akka://pipeline/user/$u] Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: os.name: 'Linux', os.arch: 'amd64', os.version: '3.14.48-33.39.amzn1.x86_64', java.version: '1.8.0_60'
Driver info: driver.version: PhantomJSDriver
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: os.name: 'Linux', os.arch: 'amd64', os.version: '3.14.48-33.39.amzn1.x86_64', java.version: '1.8.0_60'
Driver info: driver.version: PhantomJSDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:589)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:110)
at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:99)
at com.example.p.Test.ingest(GoogleGetLinksPipe.java:48)
at com.example.p.Test.ingest(GoogleGetLinksPipe.java:22)
at com.example.p.AbstractPipe.onReceive(AbstractPipe.java:39)
at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:167)
at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
at akka.actor.UntypedActor.aroundReceive(UntypedActor.scala:97)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: os.name: 'Linux', os.arch: 'amd64', os.version: '3.14.48-33.39.amzn1.x86_64', java.version: '1.8.0_60'
Driver info: driver.version: PhantomJSDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
at org.openqa.selenium.phantomjs.PhantomJSCommandExecutor.execute(PhantomJSCommandExecutor.java:78)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
... 20 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:8092/status] to be available after 20000 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
... 22 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 23 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:130)
... 24 more
I built the PhantomJS from source and had it working before - it ran through the tests just fine. Additionally, it works locally on my machine. Any thoughts on what could be causing the issue?
The problem was due to the phantomjs's inability to write to the log file. Changing the file permissions of the log file resolved the issue.