Open MSlaski opened 1 year ago
Please include the full Appium log from startup?
@jlipps
╭─name@PC.lan ~
╰─➤ appium server --address 127.0.0.1 --port 4723 --allow-cors
[Appium] Welcome to Appium v2.0.0-beta.66
[Appium] Non-default server args:
[Appium] {
[Appium] address: '127.0.0.1',
[Appium] allowCors: true
[Appium] }
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at /Users/mateusla/.appium/node_modules/appium-uiautomator2-driver
reusing global emitter
[Appium] Attempting to load driver xcuitest...
[debug] [Appium] Requiring driver at /Users/mateusla/.appium/node_modules/appium-xcuitest-driver
[Appium] You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[Appium] Available drivers:
[Appium] - uiautomator2@2.24.0 (automationName 'UiAutomator2')
[Appium] - xcuitest@4.26.0 (automationName 'XCUITest')
[Appium] Available plugins:
[Appium] - execute-driver@2.0.6
[Appium] - relaxed-caps@1.0.5
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
It doesn't seem that any connections are hitting this server at all. Does your test script have the correct host and port listed?
Yup, it should use correct values. Again, Driver initialisation:
XCUITestOptions options = new XCUITestOptions();
options.setPlatformName(Platform.IOS.name());
options.setPlatformVersion(device.getPlatformVersion());
options.setDeviceName(device.getName());
options.setUdid(device.getUdid());
options.setBundleId("MY_BUNDLE_ID");
options.setXcodeCertificate(new XcodeCertificate("GY9QC33CMS", "Apple Development"));
options.setAutomationName(AutomationName.IOS_XCUI_TEST);
options.setIncludeSafariInWebviews(true);
IOSDriver driver = new IOSDriver(new URL("http://127.0.0.1:4723"), options);
As you can see the URL is 127.0.0.1 with port 4723
@MSlaski Do you see any errors on the client side?
Full stack trace paste below.
I made few more tests now. Start Appium server (same way like mentioned above). Tried to connect via Appium Inspector - it failed with error code 70. WDA can't start. I install new WDA Runner via Xcode directly on the device and Trust the developer
After that (Automation was not running) I was able to connect to device via Appium Inspector. When I closed connection I tired to run test and it failed
Definition.userCanOpenApplication(com.idemia.pivt.helpers.MobileDevice)
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'POLO-1357.lan', ip: 'fe80:0:0:0:1835:b628:a560:a83b%en0'
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:229)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:80)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:92)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:106)
at com.idemia.pivt.step_definitions_mobile_native.ScanQrCodeStepDefinition.userCanOpenApplication(ScanQrCodeStepDefinition.java:46)
at ✽.user can open application on device IP13(file:///Users/mateusla/Work/Repos/pivt-integration-tests/pivt-bdd-tests/src/test/resources/features/id&v_native_front_or_back_page.feature:8)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '4.5.3', revision: '4b786a1e430'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '11.3', java.version: '11.0.11'
Driver info: driver.version: IOSDriver
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:130)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:155)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:189)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:541)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:229)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:80)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:92)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:106)
at com.idemia.pivt.step_definitions_mobile_native.ScanQrCodeStepDefinition.userCanOpenApplication(ScanQrCodeStepDefinition.java:46)
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 io.cucumber.java.Invoker.doInvoke(Invoker.java:66)
at io.cucumber.java.Invoker.invoke(Invoker.java:24)
at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:47)
at io.cucumber.java.JavaStepDefinition.execute(JavaStepDefinition.java:29)
at io.cucumber.core.runner.CoreStepDefinition.execute(CoreStepDefinition.java:66)
at io.cucumber.core.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:63)
at io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)
at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:85)
at io.cucumber.core.runner.TestStep.run(TestStep.java:57)
at io.cucumber.core.runner.PickleStepTestStep.run(PickleStepTestStep.java:51)
at io.cucumber.core.runner.TestCase.run(TestCase.java:84)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:75)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.lambda$run$0(PickleRunners.java:151)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:148)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:144)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:28)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at io.cucumber.junit.FeatureRunner.run(FeatureRunner.java:137)
at io.cucumber.junit.CucumberSerenityRunner.runChild(CucumberSerenityRunner.java:259)
at io.cucumber.junit.CucumberSerenityRunner.runChild(CucumberSerenityRunner.java:59)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at io.cucumber.junit.CucumberSerenityRunner$RunCucumber.evaluate(CucumberSerenityRunner.java:288)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:188)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:154)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
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:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:126)
... 74 more
Caused by: java.lang.NoClassDefFoundError: io/netty/handler/codec/DefaultHeaders$ValueValidator
at org.asynchttpclient.RequestBuilderBase.<init>(RequestBuilderBase.java:98)
at org.asynchttpclient.RequestBuilderBase.<init>(RequestBuilderBase.java:92)
at org.asynchttpclient.RequestBuilder.<init>(RequestBuilder.java:35)
at org.asynchttpclient.RequestBuilder.<init>(RequestBuilder.java:31)
at org.asynchttpclient.Dsl.request(Dsl.java:73)
at org.openqa.selenium.remote.http.netty.NettyMessages.toNettyRequest(NettyMessages.java:58)
at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:56)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at io.appium.java_client.remote.AppiumCommandExecutor.lambda$createSession$0(AppiumCommandExecutor.java:158)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at io.appium.java_client.remote.AppiumCommandExecutor.lambda$createSession$0(AppiumCommandExecutor.java:158)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:120)
... 79 more
Caused by: java.lang.ClassNotFoundException: io.netty.handler.codec.DefaultHeaders$ValueValidator
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 95 more
no clue then. the issue is not with the appium server so i'm out of ideas. seems like a client side issue somehow.
I also tried at different device, the same issue. Appium inspector is able to connect, java-client not
This is a dependency conflict issue. Please use java-client version 8.5.0 and let it download all the required selenium dependencies.
Hello @saikrishna321 Unfortunately it's still the same issue. java-client upgraded to 8.5.0, selenium-java to 4.9.1
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'POLO-1384.local', ip: 'fe80:0:0:0:10fa:c52b:fed1:94b7%en0'
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:274)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:89)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:101)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:104)
appium server --address 127.0.0.1 --allow-cors
[Appium] Welcome to Appium v2.0.0-beta.66
[Appium] Non-default server args:
[Appium] {
[Appium] address: '127.0.0.1',
[Appium] allowCors: true
[Appium] }
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at /Users/mateusla/.appium/node_modules/appium-uiautomator2-driver
reusing global emitter
[Appium] Attempting to load driver xcuitest...
[debug] [Appium] Requiring driver at /Users/mateusla/.appium/node_modules/appium-xcuitest-driver
[Appium] You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[Appium] Available drivers:
[Appium] - uiautomator2@2.24.0 (automationName 'UiAutomator2')
[Appium] - xcuitest@4.26.0 (automationName 'XCUITest')
[Appium] Available plugins:
[Appium] - execute-driver@2.0.6
[Appium] - relaxed-caps@1.0.5
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
Host info: host: 'POLO-1384.local', ip: 'fe80:0:0:0:10fa:c52b:fed1:94b7%en0'
address: '127.0.0.1',
Maybe the client tries to connect to ipv6 address while the server is only listening on ipv4 one?
@mykola-mokhnach do you know how to verify that?
During Driver initialisation Im providing IPv4 address. I checked also help for Appium server and didn't find anything related to IPv4 or IPv6
if you start the appium server with -a 0.0.0.0
does it help?
@jlipps Same when I tried yo use address 0.0.0.0 - for both server and Driver initialisation :/
@MSlaski don't use it in driver initialization. Only in server.
@jlipps Unfortunately it is still not working. server started with -a 0.0.0.0. Java Client can't connect. Also tried with Appium Inspector and using address 127.0.0.1 I was able to connect to device so still the same issue
k sounds like it's a java client issue then, which I can't help with.
hi I am also facing the same with appium 2,did we have any solution for this
I also faced it, i just deleted the selenium dependency and update maven project now it is working for me. and all selenium classes, methods i got from java client 8.5.0
Oh ya, updated the selenium dependency to latest and java client as well,It worked,Thanks
The same issue for me with java-client 8.5.1 and selenium 4.11.0... if I remove selenium dependency -> then test is working with appium 2 server. If selenium dependecy is present -> org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
upd:
you should do like this:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.11.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>4.11.0</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>8.5.1</version>
</dependency>
it will work
Is there an existing issue for this?
Current Behavior
After migration from Appium 1 to Appium 2 (also Selenium 3 to Selenium 4) all my tests are not working. The issue is related to connection from java client to local Appium server
Java code is returning error:
Server is not logging anything from this test Im starting server via CLI:
appium server --address 127.0.0.1 --port 4723 --allow-cors
*I know that the port 4723 is a default one so can be omittedWhen I will call simple GET /status or /sessions I can reach response from my local server:
Im trying to run test on real iOS Device (which was used by Appium 1 already - so was working before the upgrade)
Driver Initialisation:
When Im trying to use Appium Inspector it is possible to attach to the device but first, I have to run WebDriverAgentRunner application on my iOS Device, without that it will not work. Even when WDA Runner was launched and Im trying to start tests, the connection is still not working.
My Pom:
I tried many things and always failed to run some tests. The same for Android Device and also regular Selenium Driver is not starting any browser. At the moment the most important thing is to fix Appium to unblock native mobile tests
BR Mateusz
PS Im not able to register or login to discuss Appium forum. All options are not working for me (email, GitHub, google) that's why Im asking for support here
Expected Behavior
Java-client 8 can connect to local Appium server 2
Minimal Reproducible Example
Already put at actual behaviour section
Environment
appium
CLI...appium --version
): 2.0.0-beta.66node --version
): v19.7.0npm
version (output ofnpm --version
): 9.5.0appium
version which did not exhibit the problem: Appium 1Link to Appium Logs
No response
Futher Information
No response