Selenium grid Console showing "[/127.0.0.1] failed: Connection refused" - appium

Please refer to attached screen shot. I've registed 2 emulators to Selenium HUB ( started appium server for each of them )
But it's showing this error message, I'm not sure what does it mean ? Is there something I'm doing wrong ?
Please clarify
To keep it simple I tried launching HUB and registering appium nodes from command line
I got below output from command line
appium --nodeconfig EMULATOR_Nexus_4_1.json
[Appium] Welcome to Appium v1.6.3
[Appium] Non-default server args:
[Appium] nodeconfig: 'EMULATOR_Nexus_4_1.json'
[debug] [Appium] Starting auto register thread for grid. Will try to register every 5000 ms.
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [Appium] Appium successfully registered with the grid on localhost:4444
But on hub console, still seeing same error per screen shot. Not sure what may be going wrong here ?

node config file entry was wrong earlier.
Worked with below
{"capabilities":[{"browserName":"Nexus_4_1","version":"4.4.2","maxInstances":1,"platform":"ANDROID"}],"configuration":{"nodeTimeout":120,"port":4723,"hubPort":4444,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","hubHost":"127.0.0.1", "nodePolling":2000, "registerCycle":10000,"register":true,"cleanUpCycle":2000,"timeout":30000,"maxSession":1}}
Refereed to http://www.vimalselvam.com/2016/05/15/selenium-grid-for-appium-mobile-automation/

Related

Chrome Devtools Remote IOS Debugging Network Domain Not Found

I am trying to setup remote debugging between a Win 7 laptop running chrome and an Apple iPhone running Safari. I am using chrome-devtools to establish the connection. I am using an ios-webkit-debug-server on the laptop and a python3 local http.server on the iPhone. I can get the laptop to connect and identify the iphone as a remote device. I copy and paste the link to devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/1. I get the following messages. I have tried disablining the firewall but no change. It appears that devtools cannot setup the network logging because it cannot find the network domain.Any help would be appreciated.
iPhone
IOS V12.5.1
Turned Web Inspector On
Start Server with Python3 -m http.server
In Safari (V12.5.1) I navigate to http://localhost:8000/test.html
Laptop
OS is Win 7
I start Powershell 7.1.3 running as administrator (WMF 5.1)
I start "ios-webkit-debug-server -f chrome-devtools://devtools/bundled/inspector.html"
I get Listing devices on :9221
I get Connected :9222 to jim's iPhone (??????...)
On Chrome I navigate to localhost:9221
I get "iOS Devices: 1. localhost:9222 - jim’s iPhone"
I click localhost:9222
I get "Inspectable pages for jim’s iPhone: 1. http://localhost:8000/test.html
I copy and paste "devtools://devtools/bundled/inspector.html?ws=localhost:9222/devtools/page/1"
I get following messages (Truncated error messages different commands network domain not found)
-07:27:59:432 Main._createAppUI: 39.85693359375 ms
-07:27:59.472 main.js:1 Main._showAppUI: 44.3681640625 ms
-07:27:59.616 main.js:1 Main._initializeTarget: 34.602783203125 ms
-07:27:59.718 main.js:1 Main._lateInitialization: 0.56689453125 ms
-07:28:00.424 protocol_client.js:1 Request Network.enable failed. {"code":-32601, "message":"
'Network' domain was not found","data":[{"code":-32601,"message":"'Network'domain was not found"}]}

How session works on client-server architecture of Appium?

I want to study details about how the Appium server works, so while studying about the architecture, I am not getting a clear idea about how the session works on Appium server.
There are two components to running Appium automation tests - Appium server and Appium session. Appium server is a REST interface listener, while an Appium session is the entity which makes REST calls to Appium server in order to perform actions such as finding & clicking web elements. The session is tied to a device such as Android emulator or real device.
You can start an Appium server without starting an Appium session, but you cannot start an Appium session without starting an Appium server.
When you have Appium properly installed, you can open the Command prompt & enter appium. You will see a message indicating the Appium REST listener has started, and is listening on a specific address, such as 0.0.0.0:4327.
When you start an Appium session, you have to ensure your session is connecting to the correct port. If you start Appium server on 0.0.0.0:4327, but then try to start a session on 0.0.0.0:5555, the session will not start.
The Appium session uses underlying libraries such as node and Java to interact with web elements. The code is publicly available on https://github.com/appium/appium so you can view the complete architecture and session / server relationship here if you'd like.

calabash-ios: The app hangs when running automation

I'm using the simulator (iOS 9.0).
I’m running the command: device_target=UDID cucumber
The simulator starts and the app is loading, but then the console hang for few min until time out.
I have the same issue when I run it manually in the console:
calabash-ios console
start_test_server_in_background
The error that I get is:
#<RuntimeError: Timed out connecting to Calabash server after 10 retries. Make sure it is linked and App isn't crashing>
RuntimeError: Unable to make connection to Calabash Server at http://localhost:37265/`
Make sure you don't have a firewall blocking traffic to http://localhost:37265/.
running the command curl http://localhost:37265 and get the error - curl: (7) Failed to connect to localhost port 37265: Connection refused
what I’m missing?
(the app developed in Xamarin)
device_target=UDID cucumber
This is not doing what you expect. Calabash responds to DEVICE_TARGET not device_target.
My best guess is that you need to check whether your .app is linked with Calabash.
Please see these two pages:
https://github.com/calabash/calabash-ios/wiki#reporting-problems
https://github.com/calabash/calabash-ios/wiki/Updating-your-Calabash-iOS-version#what-version-of-the-server-is-embedded-in-my-app

How to run appium on headless Linux

How do I run tests in headless fashion (for web testing I use XVFB for running browser tests in headless on Jenkins), so how it will work for automation on AVD/Device
I am trying to run a mobile web test using appium on Centos 6 headless linux but I am keep getting this error:
"info: [CHROMEDRIVER STDERR] No protocol specified
info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error
occurred while processing the command.","origValue":"**unknown error: an X display is required for
keycode onversions, consider using Xvfb\n** (Session info: chrome=webview)\n
(Driver info:chromedriver=2.9.248316,platform=Linux 2.6.32042stab088.4x86_64)"},
"sessionId":"8563fbe5972f3ba87673c7a082d49d22"}POST /wd/hub/session/8563fbe5972f3ba87673c7a082d49d22/element/0.06753459526225924-1/value 500 1927ms - 395b
debug: Appium request initiated at /wd/hub/session/8563fbe5972f3ba87673c7a082d49d22
debug: Request received with params: {}
info: Shutting down appium session..."
It opens up the chrome browser and navigates to the given url. After that it tries sendKeys to the username field and then it fails.
We just had this issue and solved it by wrapping the appium server call in a call to xvfb:
xvfb-run appium --session-override --command-timeout=0 &
(or whatever you appium server settings are)
xvfb-run will then handle the headless server setup and shutdown for you.

Error when launching using appium

I am getting an error when I am launching the appium for android. I started node.js by double ckicking node.js then I gave the path of my apk file and then clicked on launch buttonand in console i got following error:
Starting Node Server
Starting Appium in pre-launch
Pre-launcing app
Using fast reset?false
No app-activity desired capability or server param.Parsing from apk.
No app-package desired capability or server param.Parsing from apk.
Using local app from command line: C:\Users\ssharma\lowes-android-app-Wolverine-Sprint6-2014-04-29_17-03-13.apk
Creating new appium session 4aa75228-984f-46f7-8b09-50221dc19875
starting android appium
Preparing device for session
Checking whether app is actually present
Checking whether adb is actually present
Sent shutdown command,waiting for UiAutomator to stop...
Uiautomator did not shut down fast enough calling it gone
Error:
Node Server Process Ended
Please help me in this issue.
What machine are you running on ? On windows you can use exe and on mac you can use app and then pass correct capabilities from appium client.

Resources