Selendroid is not working? - selendroid

http://selendroid.io/setup.html
Here is given an example of what I should get when I open localhost at port 4444.
But instead I get:
{"value":{"os":{"name":"Windows 7","arch":"x86","version":"6.1"},"build":
{"browserName":"selendroid","version":"0.10.0"},"supportedDevices":[],"supportedApps":
[{"mainActivity":"io.selendroid.androiddriver.WebViewActivity","appId":"io.selendroid.androiddriver:0.10.0",
"basePackage":"io.selendroid.androiddriver"}]},"status":0}
A device is connected to the PC and it has no screenlock, but it is not detected.
What's wrong?
(I don't have exp with Selenium or Selendroid and trying to start now)

On your device, you need to switch ON the USB debugging which is under developer mode.
then type command on command promt: adb devices
it should display attached devices.

Related

Remote debugging Internjs that runs on selenium chromedriver

I try to remotely debug tests run by Internjs.
Basically it is a Chrome that is run by Selenium and Chromedriver.
I set up Chromedriver debuggerAddress option as
debuggerAddress: '127.0.0.1:8765'
Now when I run tests Selenium waits some time and than fails with message:
FATAL ERROR
UnknownError: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"browserName":"chrome","name":"tests/intern_local","idle-timeout":60,"selenium-version":"2.44.0","chromeOptions":{"debuggerAddress":"127.0.0.1:8765"}}}] unknown error: cannot connect to chrome at 127.0.0.1:8765
from chrome not reachable
(Driver info: chromedriver=2.12.301326 (093c7e07b4a916b690e784b0374c7f618f1ea4be),platform=Mac OS X 10.10.1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.64 seconds
I'm not sure what I have to do so that chrome would connect to server.
I did try:
Running chromedriver on that port ./chromedriver_2.11 --port=8765
Running chrome with --remote-debugging-port=8765
But I have no other ideas how to start a chrome debug server.
Useful links that I did try that that did not work for me:
Remote debugging protocol
Remotely debugging Chrome Desktop
Chromedriver Capabilities (aka ChromeOptions)
Update 1 Forcing Chromedriver to use a Chrome instance with remote debugging on
Run a new Chrome instance as in Mozilla article
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=$(mktemp -d -t 'chrome-remote_data_dir')
In intern set
intern.capabilities = {
'selenium-version': '2.44.0'
, 'chromeOptions': {
debuggerAddress: '127.0.0.1:9222'
}
};
Now when you run Intern tests Intern will use your previously open Chrome instance. Now you can open localhost:9222 and you'll see that you can debug that tab in which tests run. However for me I'm just able to see that remote tab, but clicking on it does nothing.
I also tried Firefox WebIDE. I tried to connect to localhost:9222, it starts to load and after some time it says that it can't connect.
I tried something similar this evening, without using a framework. I opened a webdriver session & added the remote debugger capabilities.
It seems that it is not possible to run a webdriver session & remote debug at the same time. I asked some Google guys to verify that, but haven't received an answer yet.

WebRtc2SIP: No video is been received/transmitted when made call between chrome and a SIP client

I am a newbie to webrtc2sip. I have setup my webrtc2sip gateway and registered to sip2sip.info as my domain. The problem is when I make video calls from chrome to any SIP client(ekiga/jitsi) the call gets connected but I am unable to see videos on both the sides.
==================================================================================
Case 1: Chrome calls SIP client
Result: No video shown on both transmit and receive side
==================================================================================
On the chrome JS console it says that :
State machine: tsip_dialog_register_InProgress_2_Connected_X_2xx SIPml-api.js?svn=179:1
==session event = m_stream_video_local_added SIPml-api.js?svn=179:1
==session event = m_stream_video_remote_added SIPml-api.js?svn=179:1
==session event = m_stream_audio_local_added SIPml-api.js?svn=179:1
==session event = m_stream_audio_remote_added SIPml-api.js?svn=179:1
I have attached the JS console logs(case1_web2SIPClient_JSLogs.txt), wireshark trace(case1_web2SIPClient_WStrace.pcap) , webrtc2sip gateway console logs(case1_web2SIPClient_gatewayLogs.txt), sipml5 expert settings (Expert_settings.png) and config.xml (config.xml) for this case. I did not change anything in the config.xml that was generated after i built the source as mentioned in the instructions of this page (http://linux.autostatic.com/installing-webrtc2sip-on-ubuntu-1204).
I gave a try making calls between chrome and a android SIP client (CSipSimple) and the problem remains the same.
==================================================================================
case 2: SIP client calling chrome.
Result: as soon as I click answer button on chrome, the calls gets rejected.
==================================================================================
The JS console logs states that:
State machine: tsip_transac_ist_Proceeding_2_Completed_X_300_to_699 SIPml-api.js?svn=179:1
SEND: SIP/2.0 603 Failed to get local SDP
Via: SIP/2.0/WS 172.21.128.118:10060;rport=10060;branch=z9hG4bK-1441398960
From: <sip:tata#172.21.229.127>;tag=300647977
To: <sip:amshyam320#sip2sip.info>;tag=ZxQFfM7fIIP3rT1HINzb
Call-ID: fbdf5a11-ff9e-0072-fa8b-09525220cec6
CSeq: 1670757835 INVITE
Content-Length: 0
Reason: SIP; cause=603; text="Failed to get local SDP"
For this case I am attaching JS logs(case2_SIPClient2WebJSLogs.txt), wireshark dump(case2_jitsiToWeb_WStrace.pcap)
Configuration:
Chrome Version: checked on 30.0.1599.114 and even on Latest chrome version
Webrtc2sip version: 2.6.0
sipml5 Version: svn=203
ubuntu version: 12.04 (checked on both desktop and server editions)
Am I missing something in my setup or configuration please guide and help in moving further.
Thanks,
Shyam
Case2:
You're using RTCWeb-capable browser(Chrome) and trying to call a SIP client which may not be implementing some mandatory features like ICE,SRTP. Chrome uses SRTP-SDES and Firefox uses SRTP-DTLS.
Enable RTCWeb Breaker in sipml5 expert settings and check.
The RTCWeb Breaker is used to enable audio and video transcoding when the endpoints do not support the same codecs or the remote server is not RTCWeb-compliant.
Case:1:
Is audio working? and I can't see your logs.

Unable to Launch Chrome Browser in Selenium

I am launching chrome browser using
selenium = new DefaultSelenium("localhost", 4444, "*googlechrome",
"https://example.com/");
But i get a popup with following message and it freezes:
An administrator has installed Google Chrome on this system, and it is available for all users. The system-level Google Chrome will replace your user-level installation now.
Console Log till point of freeze:
Server started
16:06:37.792 INFO - Command request: getNewBrowserSession[*googlechrome, https://example.com/, ] on session null
16:06:37.796 INFO - creating new remote session
16:06:38.081 INFO - Allocated session beb925cd0418412dbe6319fedfb28614 for https://example.com/, launching...
16:06:38.082 INFO - Launching Google Chrome...
Any suggestions?
Try giving location of your chrome exe too along with browser name like this :
selenium=new DefaultSelenium("localhost", 4444, "*googlechrome C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "https://example.com");

Sniffing for WOL packets on port 9

So I am using XBMC (a media center program) that has an Android app with a feature that allows you to send Wake on LAN "magic packets" to computers you have XBMC installed on. While this would be a great feature for me if I had a dedicated media PC that auto-ran XBMC on startup, I use it instead on my normal desktop PC.
What I would like to do is see if I can write a little listener script that would run on my PC that would listen for those magic packets sent over port 9 and just start the XBMC application.
Some of my friends say that you cannot listen on this port. The Google searches on "port 9", "wake on lan", and "simple TCP/IP" I've performed remain inconclusive as to weather or not this is possible.
With Python and pcap (winpcap and pypcap http://code.google.com/p/pypcap/). Not very nice but works for me.
import os, pcap
pc = pcap.pcap()
pc.setfilter('udp port 9 and (udp[8:4] == 0xFFFFFFFF and udp[12:2] == 0xFFFF)')
for ts, pkt in pc:
os.system(r'"C:\Program Files (x86)\XBMC\xbmc.exe"')
You should be able to do this on a Windows PC. However your program will not run on a *Nix style system without having superuser, or using a privilege escalator program like jsvc.

Starting google-chrome via Selenium on headless debian system

I'm trying to start the google-chrome browser in disabled web security mode. The selenium log says:
15:36:33.526 INFO - Command request: getNewBrowserSession[*googlechrome, http://www.myurl.de, , commandLineFlags=--disable-web-security] on session null
Anyways, it just hangs after
15:36:33.600 INFO - Launching Google Chrome...
Here's the stack trace:
16:36:44.605 ERROR - Failed to start new browser session, shutdown browser and clear all session data org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:564) at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:521) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:374) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Selenium is started by robotframework by the robotframework-maven-plugin. Also xvfb is started by the maven build script to simulate a display. But the startup configuration does not seem to be the problem. Everything starts fine, just the browser won't get up.
I hope anyone can help me.
Make sure that the user account that is launching the browser has a home directory. Otherwise the browser profile creation will fail.