8000 Xebium is incompatible with ios-driver against a native app · Issue #145 · xebia/Xebium · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Xebium is incompatible with ios-driver against a native app #145

Open

Description

When trying to use Xebium with the ios-driver http://ios-driver.github.io/ios-driver/?page=home I noticed that it does not work. Using a proxy tool (Charles Proxy) I noticed that Xebium is making requests that ask the WebDriver to evaluate JavaScript code, as if it were a brrowser app. When running the same test from Python against the WebDriver, no such thing happens.

Here in Python:

from selenium import webdriver
cap = {
'device' : 'iphone',
'language': 'en',
'locale': 'en_US',
'CFBundleName': 'InternationalMountains',
'simulator':True,
'variation':'iPhone5s'
}
driver = webdriver.Remote("http://localhost:5555/wd/hub", cap)
cellByName = driver.find_element_by_name ("Mountain 1")
print (cellByName)
cellByName.click()

Here's the wire (all works fine):

POST /wd/hub/session/9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7/element HTTP/1.1
Accept-Encoding: identity
Content-Length: 93
Host: 127.0.0.1:5555
Accept: application/json
User-Agent: Python-urllib/2.7
Connection: close
Content-Type: application/json;charset=UTF-8

{"using": "name", "sessionId": "9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7", "value": "Mountain 1"}

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Connection: close
Server: Jetty(8.y.z-SNAPSHOT)

{"state":null,"sessionId":"9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7","hCode":887467035,"value":{"ELEMENT":"4","type":"UIATableCell"},"class":"org.openqa.selenium.remote.Response","status":0}

POST /wd/hub/session/9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7/element/4/click HTTP/1.1
Accept-Encoding: identity
Content-Length: 64
Host: 127.0.0.1:5555
Accept: application/json
User-Agent: Python-urllib/2.7
Connection: close
Content-Type: application/json;charset=UTF-8

{"sessionId": "9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7", "id": "4"}

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Connection: close
Server: Jetty(8.y.z-SNAPSHOT)

{"state":null,"sessionId":"9dee5f9f-e373-4b5a-bef1-e2cce2fe5bc7","hCode":602051175,"value":"","class":"org.openqa.selenium.remote.Response","status":0}

And here it is from FitNesse:

| script |
|start browser |{"remote": "${url}", "device" : "iphone", "language": "en", "locale": "en_US", "CFBundleName": "InternationalMountains", "simulator": "true", "variation":"iPhone5s", "instruments": "true"} |on url    |http://www.apple.com|
| ensure | do | click | on | name=Mountain 1 |
|stop browser |

And this is the wire:

POST /wd/hub/session/241e691b-522a-4e3d-aa7b-0ccd586b742e/execute HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 74005
Host: localhost:5555
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.3.6 (java 1.5)
Accept-Encoding: gzip,deflate

{"script":"return (function() { return (function(){return function(){var k,l\u003dthis;function n(a){return void 0!\u003d\u003da}\nfunction aa(a){var b\u003dtypeof a;if(\"object\"\u003d\u003db)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c\u003dObject.prototype.toString.call(a);if(\"[object Window]\"\u003d\u003dc)return\"object\";if(\"[object Array]\"\u003d\u003dc||\"number\"\u003d\u003dtypeof a.length\u0026\u0026\"undefined\"!\u003dtypeof
...
[stuff deleted - it was a gigantic script]
...
\nfor(var Xd;Vd.length\u0026\u0026(Xd\u003dVd.shift());)!Vd.length\u0026\u0026n(Ud)?Wd[Xd]\u003dUd:Wd\u003dWd[Xd]?Wd[Xd]:Wd[Xd]\u003d{};; return this._.apply(null,arguments);}.apply({navigator:typeof window!\u003dundefined?window.navigator:null,document:typeof window!\u003dundefined?window.document:null}, arguments);}\n).apply(null, arguments);})(arguments[0]);","args":["name\u003dMountain 1"]}

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 180
Server: Jetty(8.y.z-SNAPSHOT)

{"state":null,"sessionId":"241e691b-522a-4e3d-aa7b-0ccd586b742e","hCode":1252021692,"value":"Can't find variable: window","class":"org.openqa.selenium.remote.Response","status":17}

I tried to disable the fast xebium emulation, it did not fix the problem:

| use fast selenium emulation | false |

Is there a way to make Xebium work properly like when using the WebDriver? Why is it insisting in trying to execute JavaScript against the DOM? There's no DOM in a native IOS app.

Activity

  1. raboof commented on Jun 29, 2015

    @raboof
    Contributor

    I'm not sure, but could you try setting the 'useFastSeleniumEmulation' option on SeleniumDriverFixture? I'm afraid this'll only work for some commands, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0