Mac M1 - Unable to programmatically launch Appium using java appium client - appium

Appium server is initiated and then throws Java.net Timeout exception

Related

“adb devices” detect my device but not Appium server, why?

Environment:
Windows 10
Python 3.7.9
Appium 1.22.3
Node v12.15.0
Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
Sdkmanager 4.0.1
Appium-Python-Client==2.4.0
Problem:
Appium doesn't detect my device:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Device E531XE1ZM11302266 was not in the list of connected devices
at getResponseForW3CError (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
at asyncHandler (C:\Users\gauth\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)
So I run the command "adb devices" which shows correctly my device.
Is there any process to fix this kind of issue please? How could I fix that?

Getting exception while running test case in appium

I am a newbie to Appium, recently i am trying to run my first appium test case, but getting below error:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session.
I am using appium server 1.6.3 on localhost, and also i am using selenium server 3.4.0 and appium java client version java-client-5.0.0-BETA7.
Please help me out to resolve this issue.
Thanks in advance
Several notes:
avoid using beta builds when you start with new open-source tool
Appium already includes specific selenium version, so by setting it yourself you may get incompatibility issue.
Try with appium stable appium server v1.7.2 and java client v5.0.4

Appium: 504 error gateway timeout

Appium launches the safari browser, clicks on Launch Safari Button and errors out
2016-09-22 19:57:32:206 - [MJSONWP] Encountered internal error running command: Error: Could not navigate to webview! Err: 504 - 504 Gateway Timeout
Gateway Timeout
Server error - server 127.0.0.1 is unreachable at this moment.
Please retry the request or contact your administrator.
Environment
Appium version (or git revision) that exhibits the issue:15.3
Desktop OS/version used to run Appium: MAC
IOS Mobile platform: 9.2
Real device: Ipad Air
libimobiledevice : HEAD
Details
Link to Appium logs
https://gist.github.com/rjmadhu/c77fe1753af07c8bc337174fc5501d24
Try restarting your appium server and see if you are able to see the error again. Gist that has been posted cannot be seen any more.

Chrome Driver not working on android real devices using Appium

I have installed the chrome driver - version 37.0 and source -com.android.chrome-1.apk
Started the adb command and device is connecting properly. Enable the debug mode and checked usb device option
Capabilties -
below is code snippet which i have used to call the chrome browser
capabilities.setCapability("appium-version", "1.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("platformVersion", "4.3");
capabilities.setCapability("deviceName", "abc");
capabilities.setCapability("browserNamex", "Chrome");
driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);
Getting below error -
error: Chromedriver create session did not work. Status was 200 and body was {"sessionId":"e70c1dff331b9b35ce5e4b974ae3d47e","status":13,"value":{"message":"unknown error: com.android.browser is not installed on device 43001beab8cb1161\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.2 x86_64)"}}
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Did not get session redirect from Chromedriver
info: <-- POST /wd/hub/session 500
i am using appium on windows for android. try using appium 1.1.0.0 just launch server through appium. set these capabilities in Eclipse
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,"Chrome");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.3");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"GT-I9300");
driver = new RemoteWebDriver(new URL(:1:4723/wd/hub"), capabilities);
its working for me .
thanks
Rohit Vyas
I had the same issue and found that I was running version of chrome browser which is less than 33 and this requires devices to be rooted. I update chrome browser to 40+ (I guess it was 48) and issue disappeared.
Device rooting requirement for version of chrome lower than 33 is available here -
http://appium.io/slate/en/master/?ruby#mobile-chrome-on-emulator-or-real-device
Maybe it will help someone looking for solution to this error:
error: Chromedriver create session did not work. Status was 200 and
body was
{"sessionId":"e70c1dff331b9b35ce5e4b974ae3d47e","status":13,"value":{"message":"unknown
error: com.android.browser is not installed on device
43001beab8cb1161\n (Driver info: chromedriver=2.10.267517,platform=Mac
OS X 10.9.2 x86_64)"}} debug: Cleaning up appium session error: Failed
to start an Appium session, err was: Error: Did not get session
redirect from Chromedriver
After long struggle with that, what helped me was overwriting the original chromedriver (the one that gets automatically downloaded when you run ./reset.sh --android ) in [my appium installation location]/build/chromedriver/linux with a file manually downloaded from this site.
Make sure you delete old chromedriver and name the new one the same as the deleted one.
I am using chromedriver 2.12
Based on this "unknown error: com.android.browser is not installed on device", it appears to be looking for the default browser instead of Chrome.
I notice there is a capability misspelled. It should be "browserName" instead of "browserNamex" like you have. That may be why it's not looking for the correct app package.
Replace chromedriver 2.18.343845 to 2.20.353145, you problem will sove in C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win path

iOS support for appium on windows

I am trying to run my script on iPHONE 5 which is connected to my windows machine. I am getting below error:
ERROR: debug: Appium request initiated at /wd/hub/session
info: Configuring Safari session
ERROR: debug: Request received with params: {"desiredCapabilities":{"browserName":"Safari","device":"iPhone 5s white"}}
info: Trying to use mobile safari, version 18
info: Looking for built in app MobileSafari
ERROR: error: xcode-select threw error Error: Command failed: 'xcode-select' is not recognized as an internal or external command,
ERROR: operable program or batch file.
ERROR:
info: Got configuration error, not starting session
ERROR: error: Stderr: 'xcode-select' is not recognized as an internal or external command,
ERROR: operable program or batch file.
ERROR:
ERROR: error: Stdout:
ERROR: error: Could not prepare mobile safari with version '18': Error: xcode-select threw an error
ERROR: error: Failed to start an Appium session, err was: Error: xcode-select threw an error
info: Cleaning up appium session
info: Error: xcode-select threw an error
at D:\QM_Work\AppiumForWindows-1.0.0\AppiumForWindows\node_modules\appium\lib\helpers.js:523:10
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: xcode-select threw an error)","origValue":"xcode-select threw an error"},"sessionId":null}
POST /wd/hub/session 500 1379ms - 204b
As mentioned in the doumenations of Appium you need OSX to test iOS:
http://appium.io/slate/en/master/?ruby#toc_25
It is possible to run the tests from a windows machine but not the way you are probably thinking. You will still need a mac. Here are the requirements:
A mac on your network with Appium server running
Has Appium environment installed properly
Has the .app on the machine
If you have these three reqirements fulfilled and there is no firewall blocking network access to the mac then you can do it. You will have to actual tests on the windows machine but instead of specifying 127.0.0.1:8080 in the setup method as the IP address of Appium server you will replace it with this: yourmacsipaddress:8080 and this should execute the test properly.
Remember that you have to specify the path of the .app in the test which is running from your windows machine. But the catch is that the path has to be the path of the .app in the mac and not on your windows machine.
So the tests will run from your Windows machine but the installation of the app, the automation, and the testing will be done on the mac but you will get the "pass" or "fail" update on your Windows machine.
You cannot use Windows for iOS testing because Appium requires Instruments and some other native, OSX-only libraries to tell the phone what to do. (source)
Workarounds:
look into a mac mini hosting service, where you can run your iOS tests on a virtual machine.
buy a mac mini

Resources