In my directory I have two files:
print.py, which contains:
import client
print('I work')
and hook-client.py, which contains:
raise RuntimeError
When I run pyinstaller --additional-hooks-dir=. print.py within said directory, no traceback/error message is outputted to the terminal (The hook file raises an error for testing reasons).
Am I missing something?
This is the output in the terminal - as you can see, there is no mention of hook-client.py:
18 INFO: PyInstaller: 4.0
18 INFO: Python: 3.8.2
24 INFO: Platform: Linux-5.4.0-42-generic-x86_64-with-glibc2.29
24 INFO: wrote /home/riz/Desktop/testing_hook/print.spec
25 INFO: UPX is not available.
26 INFO: Extending PYTHONPATH with paths
['/home/riz/Desktop/testing_hook', '/home/riz/Desktop/testing_hook']
29 INFO: checking Analysis
32 INFO: Building because hookspath changed
32 INFO: Initializing module dependency graph...
33 INFO: Caching module graph hooks...
36 INFO: Analyzing base_library.zip ...
1338 INFO: Processing pre-find module path hook distutils from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
1338 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.8'
2631 INFO: Caching module dependency graph...
2689 INFO: running Analysis Analysis-00.toc
2712 INFO: Analyzing /home/riz/Desktop/testing_hook/print.py
2713 INFO: Processing module hooks...
2714 INFO: Loading module hook 'hook-_tkinter.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2762 INFO: checking Tree
2766 INFO: checking Tree
2768 INFO: Loading module hook 'hook-lib2to3.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2774 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2774 INFO: Loading module hook 'hook-sysconfig.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2778 INFO: Loading module hook 'hook-xml.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2815 INFO: Loading module hook 'hook-distutils.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2815 INFO: Loading module hook 'hook-encodings.py' from '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks'...
2855 INFO: Looking for ctypes DLLs
2872 INFO: Analyzing run-time hooks ...
2874 INFO: Including run-time hook '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks/rthooks/pyi_rth__tkinter.py'
2874 INFO: Including run-time hook '/home/riz/.local/lib/python3.8/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
2878 INFO: Looking for dynamic libraries
3228 INFO: Looking for eggs
3228 INFO: Python library not in binary dependencies. Doing additional searching...
3248 INFO: Using Python library /lib/x86_64-linux-gnu/libpython3.8.so.1.0
3252 INFO: Warnings written to /home/riz/Desktop/testing_hook/build/print/warn-print.txt
3270 INFO: Graph cross-reference written to /home/riz/Desktop/testing_hook/build/print/xref-print.html
3278 INFO: checking PYZ
3280 INFO: Building because toc changed
3280 INFO: Building PYZ (ZlibArchive) /home/riz/Desktop/testing_hook/build/print/PYZ-00.pyz
3551 INFO: Building PYZ (ZlibArchive) /home/riz/Desktop/testing_hook/build/print/PYZ-00.pyz completed successfully.
3553 INFO: checking PKG
3553 INFO: Building because toc changed
3553 INFO: Building PKG (CArchive) PKG-00.pkg
3569 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
3569 INFO: Bootloader /home/riz/.local/lib/python3.8/site-packages/PyInstaller/bootloader/Linux-64bit/run
3569 INFO: checking EXE
3570 INFO: Building because toc changed
3570 INFO: Building EXE from EXE-00.toc
3570 INFO: Appending archive to ELF section in EXE /home/riz/Desktop/testing_hook/build/print/print
3576 INFO: Building EXE from EXE-00.toc completed successfully.
3577 INFO: checking COLLECT
WARNING: The output directory "/home/riz/Desktop/testing_hook/dist/print" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
On your own risk, you can use the option `--noconfirm` to get rid of this question.
6136 INFO: Removing dir /home/riz/Desktop/testing_hook/dist/print
6146 INFO: Building COLLECT COLLECT-00.toc
6179 INFO: Building COLLECT COLLECT-00.toc completed successfully.
Related
As per the unhelpful response from Yunnosch on Unable to run Android Emulator for connected tests in jenkins
I am running a linux box with Android studio and have setup an AVD. I can run it manually from android studio but running it like emulator -avd emulator-5554 or from Azure Pipelines gives me QT errors. I've installed QT from commandline and direct from their website with all the tools and the paths exist.
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
With debug enabled for qt plugin I was able to see the detailed errors:
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "./lib64/qt/plugins" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/Android/Sdk/emulator/lib64/qt/plugins" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64-headless" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-aarch64-headless'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel-headless" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-armel-headless'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386-headless" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386-headless'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64-headless" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: "Failed to extract plugin meta data from '/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64-headless'"
not a plugin ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "./lib64/qt/plugins/platforms" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "lib64/qt/plugins/platforms/libqxcb.so" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Warning: Found metadata in lib /usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 330752
}
((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: Got keys from plugin meta data ("xcb") ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() looking at "/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: Got keys from plugin meta data ("xcb") ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/Android/Sdk/emulator/qemu/linux-x86_64/platforms" ... ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Debug: loaded library "/usr/lib/Android/Sdk/emulator/lib64/qt/plugins/platforms/libqxcb.so" ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Warning: could not connect to display ((null):0, (null))
emulator: INFO: QtLogger.cpp:68: Info: Could not load the Qt platform plugin "xcb" in "./lib64/qt/plugins" even though it was found. ((null):0, (null))
Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
((null):0, (null))
Note: I have also added environment variables for QT but nothing worked.
I get the same error on my desktop where my default is QT_QPA_PLATFORM=wayland.
I am able to run the emulator with XWayland by specifying xcb explicitly for Qt:
env QT_QPA_PLATFORM=xcb emulator #myavd
I have a small test program using jxbrowser working on a Mac. I am trying to run the test program on a Fedora install and I connot get an instance of a Browser object.
Here is the logging of the program. Does anyone have an idea of what can cause jxbrowser to fail creating the browser ?
-- Product name: JxBrowser
-- Licensed version: 6.x
-- Licensed to:
-- License type: Evaluation
-- Generation date: Feb 23, 2017
-- Expiration date: Mar 25, 2017
-- License info: Single-user license
-- Current date: Feb 28, 2017 JxBrowser license valid. 04:27:24 INFO: OS name: Linux 04:27:24 INFO: OS version:
4.8.6-300.fc25.x86_64 04:27:24 INFO: JRE version: 1.8.0_111 64-bit 04:27:24 INFO: JxBrowser version: 6.12 04:27:24 INFO: Temp: /tmp
16:27:24:208 INFO [main] (be.lyncos.ivista.tools.Test) - Before new
Browser 04:27:24 INFO: JxBrowser type: HEAVYWEIGHT 04:27:24 INFO:
Starting IPC... 04:27:24 INFO: Starting IPC Server... 04:27:24
INFO: Starting socket server 04:27:24 INFO: Starting socket server
at port 1101... 04:27:24 INFO: Starting IPC Process... 04:27:24
INFO: Starting Chromium process... 04:27:24 INFO: The
'/lib/x86_64-linux-gnu/libudev.so.0' library exists: FALSE 04:27:24
INFO: The '/tmp/jxbrowser-chromium-55.0.2883.87.6.12/libudev.so.0'
library exists: TRUE 04:27:24 INFO: The
'/lib/x86_64-linux-gnu/libgcrypt.so.11' library exists: FALSE
04:27:24 INFO: The
'/tmp/jxbrowser-chromium-55.0.2883.87.6.12/libgcrypt.so.11' library
exists: TRUE 04:27:24 INFO: The
'/lib/x86_64-linux-gnu/libcrypto.so.1.0.0' library exists: FALSE
04:27:24 INFO: The
'/tmp/jxbrowser-chromium-55.0.2883.87.6.12/libcrypto.so.1.0.0' library
exists: TRUE 04:27:24 INFO: Command line:
/tmp/jxbrowser-chromium-55.0.2883.87.6.12/jxbrowser-chromium
--port=1101 --pid=7360 --lang=en-us 04:27:24 INFO: [0228/172724:ERROR:browser_main_loop.cc(1426)] Unable to open X
display. 04:27:24 INFO: Shared Memory Name: JXB1-7360 04:27:24
INFO: IPC connection has been established. Connection ID:
140474291099776 04:27:24 INFO: READ: OnHelloMessage{type=OnHello,
uid=1, message='cid:0,type:Main', null 04:27:24 INFO: Channel has
been accepted: SocketChannel{cid=0, bid=-1, type=Main} 04:27:24
INFO: IPC is started. 04:27:24 INFO: WRITE:
CreateBrowserMessage{type=CreateBrowser, uid=1, channelId=0,
contextId=0, cacheDir='user-data-dir/Cache',
memoryDir='user-data-dir/Memory', dataDir='user-data-dir',
currentLocale='en-us', proxyType=-1, proxyRules='null',
proxyBypassRules='null', proxyAutoConfigURL='null',
defaultZoomLevel=0.0, isOffScreenMode=false, storageType=1,
SocketInfo{cid=0, bid=-1, channelType=Main} 04:27:25 INFO: Shutting
down event queue... 04:27:25 INFO: Shutting down event queue...
[DONE] 04:27:25 INFO: Shutting down event queue... 04:27:25 INFO:
Shutting down event queue... [DONE] 04:27:25 INFO: Channel has been
disconnected: SocketChannel{cid=0, bid=-1, type=Main} 04:27:25 INFO:
IPC connection has been closed. Connection ID: 140474291099776
04:27:25 INFO: Pending IPC connections: 0 04:27:25 INFO: Chromium
process exit code 139
com.teamdev.jxbrowser.chromium.internal.ipc.IPCException: Failed to get Browser browserChannel 0
at com.teamdev.jxbrowser.chromium.Browser.a(SourceFile:396)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:207)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:178)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:145)
at be.lyncos.ivista.tools.Test.testJxBrowser(Test.java:6942)
at be.lyncos.ivista.tools.Test.main(Test.java:382)
16:29:24:674 ERROR [main] (be.lyncos.ivista.tools.Test) - Failed to get Browser browserChannel 0
com.teamdev.jxbrowser.chromium.internal.ipc.IPCException: Failed to get Browser browserChannel 0
at com.teamdev.jxbrowser.chromium.Browser.a(SourceFile:396)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:207)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:178)
at com.teamdev.jxbrowser.chromium.Browser.<init>(SourceFile:145)
at be.lyncos.ivista.tools.Test.testJxBrowser(Test.java:6942)
at be.lyncos.ivista.tools.Test.main(Test.java:382)
04:29:24 INFO: Stopping Server...
04:29:24 INFO: Stopping Server... [DONE]
04:29:24 INFO: Waiting process exit...
Thank you for your help,
Regards,
Christophe
Please make sure that your Linux environment isn't a headless environment. JxBrowser doesn't support headless linux environments without running X Server: https://jxbrowser.support.teamdev.com/support/solutions/articles/9000013733-system-requirements
Please how to remove this default log messages that are displayed when "sails lift" that also written to my external log files :
info: Starting app...
debug: Deprecation warning: Support for `sails.config.sockets.onConnect` will be
removed in an upcoming release. See the v0.11 migration guide for more informat
ion and alternate options.
info:
info: .-..-.
info:
info: Sails <| .-..-.
info: v0.12.4 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `E:\Orange\sailsJS_workspace\server`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: -------------------------------------------------------
debug: :: Wed Nov 02 2016 12:03:45 GMT+0200 (Egypt Standard Time)
debug: Environment : development
debug: Port : 1337
debug: -------------------------------------------------------
Just add:
noShip: true
To file: config/log.js
For other default log messages play with "level", it's documented in comments at beginning of file.
Set level: to silent in the log.js
Ex:
module.exports.log = {
custom: blahblahBlah,
inspect: false
level: 'info'
};
I am trying to configure Appium Grid with below node configuration.
-Hub is receiving proper capabilities from testng but hub is sending wrong capabilities to my only two nodes. (node configs are as follows )
Please do suggest where am I going wrong.
Emulator Node config
Command running the node with : node appium.js --port 4723 --nodeconfig G:\Selenium2\Grid\AppiumEmulatorNode.json
{
"capabilities": [{
"browserName": "Emulator_5.1.0",
"version": "5.1.0",
"maxInstances": 1,
"platform": "ANDROID"
}],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://192.168.0.104:4723/wd/hub",
"host": 192.168.0.104,
"port": 4723,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444 ,
"hubHost": "192.168.0.104"
}
}
Real device Node config
Command running the node with : node appium.js --port 4724 --nodeconfig G:\Selenium2\Grid\AppiumRealDevice.json
{
"capabilities": [{
"browserName": "Sony Xperia SP",
"version": "5.1.1",
"maxInstances": 1,
"platform": "ANDROID"
}],
"configuration": {
"cleanUpCycle": 2000,
"timeout": 30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url": "http://192.168.0.104:4724/wd/hub",
"host": "192.168.0.104",
"port": 4724,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444 ,
"hubHost": "192.168.0.104"
}
}
Testng file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestsSuite" parallel="tests" thread-count="2" verbose="5">
<test name="Test1">
<parameter name="UdidOrDeviceName" value="YT910LQ91K"></parameter>
<parameter name="MobileVersion" value="5.2.0"></parameter>
<classes>
<class name="com.apps.AppiumTest.AppiumMessengerTest" />
</classes>
</test>
<test name="Test2">
<parameter name="UdidOrDeviceName" value="192.168.113.101:5555"></parameter>
<parameter name="MobileVersion" value="5.1.0"></parameter>
<classes>
<class name="com.apps.AppiumTest.AppiumMessengerTest" />
</classes>
</test>
</suite>
Grid hub Output
19:47:56.092 INFO - Registered a node http://192.168.0.104:4723
19:51:05.917 INFO - Registered a node http://192.168.0.104:4724
19:51:31.419 INFO - Got a request to create a new session: Capabilities [{appActivity=com.android.mms.ui.ConversationList, appPackage=com.android.mms, platformVersion=5.2.0, newCOmmandTimeout=1000, platformName=Android, deviceName=YT910LQ91K}]
19:51:31.433 INFO - Available nodes: [http://192.168.0.104:4723, http://192.168.0.104:4724]
19:51:31.438 INFO - Got a request to create a new session: Capabilities [{appActivity=com.android.mms.ui.ConversationList, appPackage=com.android.mms, platformVersion=5.1.0, newCOmmandTimeout=1000, platformName=Android, deviceName=192.168.113.101:5555}]
19:51:31.438 INFO - Trying to create a new session on node http://192.168.0.104:4723
19:51:31.460 INFO - Trying to create a new session on test slot {maxInstances=3, platformName=ANDROID, deviceName=192.168.113.101:5555, version=5.1.0}
19:51:31.476 INFO - Available nodes: [http://192.168.0.104:4724, http://192.168.0.104:4723]
19:51:31.486 INFO - Trying to create a new session on node http://192.168.0.104:4724
19:51:31.501 INFO - Trying to create a new session on test slot {browserName=Sony Xperia SP, maxInstances=1, version=5.1.1, platform=ANDROID}
Emulator Node output
This node receiving wrong set of data from Selenium Grid.It should receive emulator capabilities but it has received real device capabilities
C:\Program Files (x86)\Appium\node_modules\appium\bin>node appium.js --port 4723 --nodeconfig G:\Selenium2\Grid\AppiumEmulatorNode.json
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"nodeconfig":"G:\\Selenium2\\Grid\\AppiumEmulatorNode.json"}
info: Console LogLevel: debug
info: [debug] starting auto register thread for grid. Will try to register every 5000 ms.
info: [debug] Appium successfully registered with the grid on 192.168.0.104:4444
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 28.871 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 11.314 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"appActivity":"com.android.mms.ui.ConversationList","appPackage":"com.android.mms","platformVersion":"5.2.0","newCOmmandTimeout":1000,"platformName":"Android","deviceName":"YT910LQ91K"}}
info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_65)
Real Device Node output
This node receiving wrong set of data from Selenium Grid.It should receive Real device capabilities but it has received emulator capabilities
C:\Program Files (x86)\Appium\node_modules\appium\bin>node appium.js --port 4724 --nodeconfig G:\Selenium2\Grid\AppiumRealDevice.json
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 0.0.0.0:4724
info: [debug] Non-default server args: {"port":4724,"nodeconfig":"G:\\Selenium2\\Grid\\AppiumRealDevice.json"}
info: Console LogLevel: debug
info: [debug] starting auto register thread for grid. Will try to register every 5000 ms.
info: [debug] Appium successfully registered with the grid on 192.168.0.104:4444
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 22.103 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 12.602 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 11.690 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 11.460 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 11.927 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"appActivity":"com.android.mms.ui.ConversationList","appPackage":"com.android.mms","platformVersion":"5.1.0","newCOmmandTimeout":1000,"platformName":"Android","deviceName":"192.168.113.101:5555"}}
info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_65)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : newCOmmandTimeout
info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
info: [debug] Creating new appium session 515cbed7-46c0-4fce-a2e0-652976c5a659
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_71
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe
warn: No app capability, can't parse package/activity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] 2 device(s) connected
info: Found device 192.168.113.101:5555
info: [debug] Setting device id to 192.168.113.101:5555
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 wait-for-device
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 22
info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] Apk doesn't exist locally
info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell "rm -rf /data/local/tmp/strings.json"
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Skipping install since we launched with a package instead of an app path
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}},"sessionId":"515cbed7-46c0-4fce-a2e0-652976c5a659"}
info: <-- GET /wd/hub/status 200 69.204 ms - 156 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}},"sessionId":"515cbed7-46c0-4fce-a2e0-652976c5a659"}
info: Starting App
info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.mms -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.IllegalStateException
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_RESULT: longMsg=UiAutomationService android.accessibilityservice.IAccessibilityServiceClient$Stub$Proxy#1034d97calready registered!
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_CODE: 0
info: [debug] UiAutomator exited
info: [debug] executing cmd: C:\Users\Harsha\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.113.101:5555 shell "echo 'ping'"
info: [debug] Attempting to uninstall app
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Cleaning up android objects
error: UiAutomator quit before it successfully launched
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: UiAutomator quit before it successfully launched
info: [debug] Error: UiAutomator quit before it successfully launched
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:205:23)
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-hybrid.js:249:5)
at Object.async.eachSeries (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:142:20)
at [object Object].androidHybrid.stopChromedriverProxies (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-hybrid.js:233:9)
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:200:10)
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:222:9)
at [object Object].androidCommon.uninstallApp (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:478:5)
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:220:12)
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js:229:11)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:901:7
at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
at ChildProcess.exithandler (child_process.js:194:7)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: UiAutomator quit before it successfully launched)","origValue":"UiAutomator quit before it successfully launched"},"sessionId":null}
Here's how the Grid decides to which node should a test be routed to.
It uses something called as a Capability Matcher, to help it decide as to which among its nodes should a test be routed to. If you don't provide a custom capability matcher [ You can take a look at this blog of mine to understand how to plugin in your own custom variant ], it resorts to relying on the DefaultCapabilityMatcher for doing this matching job.
Since you haven't set any of the attributes that the default capability matcher understands [ see here for learning what are those ], it always matches the first node with a test. That is why you are seeing the mess up.
It only understands browserName, platform, version and applicationName and for browserName, platform you cannot pass in any arbitrary values but can only use predefined values. See BrowserType and Platform java classes.
So to solve your problem, you have two options.
Option 1 : You build your own capability matcher which suites your needs (you can refer to my blog post link that I have shared above) and work with it.
Option 2 : You resort to using the capability "applicationName" wherein you provide a unique value to this for each of your nodes and then rely on your test to add this extra capability at the test level.
That should resolve your problem.
I was trying to test out a page of mine using Selenium and phpunit. I had coded it properly and tried it out on a Ubuntu 14.04 machine. It tested out properly.
However I do not remember the version of selenium server and firefox used.
Now after some issues, I had removed Ubuntu and intalled Mint on my system.
While testing the page, I get a lot of error messages and a blank firefox screen.
Current version of firefox is 30 and Selenium 2.4.2
Tried with firefox versions 25,26,27,30.
I have posted the codes below.
Any help will be appreciated.
Output of Selenium starting
java -jar selenium-server-standalone-2.42.2.jar25 Jun, 2014 3:36:17 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
15:36:17.264 INFO - Java: Sun Microsystems Inc. 20.45-b01
15:36:17.264 INFO - OS: Linux 3.13.0-24-generic amd64
15:36:17.280 INFO - v2.42.2, with Core v2.42.2. Built from revision 6a6995d
15:36:17.347 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
15:36:17.398 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
15:36:17.399 INFO - Version Jetty/5.1.x
15:36:17.400 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
15:36:17.401 INFO - Started HttpContext[/selenium-server,/selenium-server]
15:36:17.401 INFO - Started HttpContext[/,/]
15:36:17.419 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#a39ab89
15:36:17.419 INFO - Started HttpContext[/wd,/wd]
15:36:17.422 INFO - Started SocketListener on 0.0.0.0:4444
15:36:17.422 INFO - Started org.openqa.jetty.jetty.Server#5abb7465
Output of Running a PHPUnit Test
phpunit testBooking.php
PHPUnit 3.7.28 by Sebastian Bergmann.
E
Time: 5.24 seconds, Memory: 3.00Mb
There was 1 error:
1) TestBookingBlockDate::testBlock
RuntimeException: POST /session/url
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'Sworoop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.6.0_45'
Driver info: driver.version: unknown
/var/www/Folder/UnitTests/TurningStone/testBooking.php:13
/var/www/Folder/UnitTests/TurningStone/testBooking.php:13
FAILURES!
Tests: 1, Assertions: 1, Errors: 1.
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'DELETE /session
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'Sworoop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.6.0_45'
Driver info: driver.version: unknown' in /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Driver.php:127
Stack trace:
#0 /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Session.php(137): PHPUnit_Extensions_Selenium2TestCase_Driver->curl('DELETE', Object(PHPUnit_Extensions_Selenium2TestCase_URL))
#1 /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Session.php(117): PHPUnit_Extensions_Selenium2TestCase_Session->stop()
#2 [internal function]: PHPUnit_Extensions_Selenium2TestCase_Session->__destruct()
#3 {main}
thrown in /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Driver.php on line 127
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
During this I get a blank firefox window which I have to manually close.
Solved it after reinstalling PHPUnit using composer instead of apt.
Thanks everyone :)