mobileboxlab / appium-java-repl Goto Github PK
View Code? Open in Web Editor NEWSimple Java REPL for controlling mobile apps through Appium.
Home Page: https://mobileboxlab.github.io/appium-java-repl/
License: MIT License
Simple Java REPL for controlling mobile apps through Appium.
Home Page: https://mobileboxlab.github.io/appium-java-repl/
License: MIT License
java> ios.byId("WelcomeStarted").get(0).click()
[HTTP] --> POST /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/elements {"using":"id","value":"WelcomeStarted"}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: ["id","WelcomeStarted","4ccec28c-7c15-4242-9522-fbecfa4ae206"]
[debug] [XCUITest] Executing command 'findElements'
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/elements] with body: {"using":"id","value":"WelcomeStarted"}
[debug] [JSONWP Proxy] Got response with status 200: {"value":[{"ELEMENT":"0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5","type":"XCUIElementTypeButton","label":"Get Started"}],"sessionId":"AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101","status":0}
[debug] [MJSONWP] Responding to client with driver.findElements() result: [{"ELEMENT":"0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5","type":"XCUIElementTypeButton","label":"Get Started"}]
[HTTP] <-- POST /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/elements 200 267 ms - 177
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206 {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: ["4ccec28c-7c15-4242-9522-fbecfa4ae206"]
[debug] [XCUITest] Executing command 'getSession'
[debug] [JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : {\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "capabilities" : {\n "device" : "iphone",\n "browserName" : "LifeQA",\n "sdkVersion" : "10.2",\n "CFBundleIdentifier" : "com.life360.safetymap"\n }\n },\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[XCUITest] Merging WDA caps over Appium caps for session detail response
[debug] [MJSONWP] Responding to client with driver.getSession() result: {"udid":"EE7A251E-1AEE-4BE1-AF41-77F616C00958","app":"/Users/kranthi/Library/Developer/Xcode/DerivedData/SafetyMap-bepmknmoanbjekfkcdcesdxbonff/Build/Products/Debug-iphonesimulator/SafetyMap.app","platformName":"iOS","deviceName":"iPhone7","newCommandTimeout":1200,"automationName":"XCUITest","device":"iphone","browserName":"LifeQA","sdkVersion":"10.2","CFBundleIdentifier":"com.life360.safetymap"}
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206 200 66 ms - 471
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/location {}
[debug] [MJSONWP] Calling AppiumDriver.getLocation() with args: ["0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5","4ccec28c-7c15-4242-9522-fbecfa4ae206"]
[debug] [XCUITest] Executing command 'getLocation'
[debug] [JSONWP Proxy] Proxying [GET /element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/rect] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/rect] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : {\n "y" : 554,\n "x" : 112,\n "width" : 151,\n "height" : 50\n },\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[debug] [MJSONWP] Responding to client with driver.getLocation() result: {"x":112,"y":554}
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/location 200 110 ms - 89
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/size {}
[debug] [MJSONWP] Calling AppiumDriver.getSize() with args: ["0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5","4ccec28c-7c15-4242-9522-fbecfa4ae206"]
[debug] [XCUITest] Executing command 'getSize'
[debug] [JSONWP Proxy] Proxying [GET /element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/rect] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/rect] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : {\n "y" : 554,\n "x" : 112,\n "width" : 151,\n "height" : 50\n },\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[debug] [MJSONWP] Responding to client with driver.getSize() result: {"width":151,"height":50}
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/size 200 108 ms - 97
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/text {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/text] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/text] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : "Get Started",\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[JSONWP Proxy] Replacing sessionId AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101 with 4ccec28c-7c15-4242-9522-fbecfa4ae206
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/text 200 157 ms - 85
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/name {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/name] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/name] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : "XCUIElementTypeButton",\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[JSONWP Proxy] Replacing sessionId AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101 with 4ccec28c-7c15-4242-9522-fbecfa4ae206
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/name 200 109 ms - 95
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/enabled {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/enabled] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/enabled] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : true,\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 0\n}"
[JSONWP Proxy] Replacing sessionId AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101 with 4ccec28c-7c15-4242-9522-fbecfa4ae206
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/enabled 200 109 ms - 76
[HTTP] --> GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected] to [GET http://localhost:8100/session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected] with body: {}
[debug] [JSONWP Proxy] Got response with status 200: "{\n "value" : "Unhandled endpoint: \/session\/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101\/element\/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5\/selected -- http:\/\/localhost:8100\/ with parameters {\n wildcards = (\n \"session\/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101\/element\/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5\/selected\"\n );\n}",\n "sessionId" : "AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101",\n "status" : 1\n}"
[JSONWP Proxy] Replacing sessionId AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101 with 4ccec28c-7c15-4242-9522-fbecfa4ae206
[HTTP] <-- GET /wd/hub/session/4ccec28c-7c15-4242-9522-fbecfa4ae206/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected 200 4 ms - 383
Found: 1 elements
---> Text: Get Started
---> TagName: XCUIElementTypeButton
---> Enabled: true
org.openqa.selenium.WebDriverException: Unhandled endpoint: /session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected -- http://localhost:8100/ with parameters {
wildcards = (
"session/AF36CEB2-9E25-4C12-AFD6-C61BCEB4B101/element/0FFC8CF7-92BA-41A6-B1E8-4EED190E0EE5/selected"
);
}
Command duration or timeout: 7 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'Kranthis-MacBook-Pro.local', ip: '10.88.89.146', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_121'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=/Users/kranthi/Library/Developer/Xcode/DerivedData/SafetyMap-bepmknmoanbjekfkcdcesdxbonff/Build/Products/Debug-iphonesimulator/SafetyMap.app, networkConnectionEnabled=false, databaseEnabled=false, deviceName=iPhone7, platform=MAC, newCommandTimeout=1200, webStorageEnabled=false, locationContextEnabled=false, automationName=XCUITest, browserName=, takesScreenshot=true, javascriptEnabled=true, platformName=iOS, udid=EE7A251E-1AEE-4BE1-AF41-77F616C00958}]
Session ID: 4ccec28c-7c15-4242-9522-fbecfa4ae206
java>
Trying to use appium.txt
file to speed up process of launching REPL console but having obstacles that application URI component doesn't want to understand Windows path (because of backslashes) where located appium.txt
with declared capabilities and as a result I'm getting error:
java.lang.UnsupportedOperationException: Can't convert 'file:${user.home}/appium.txt' to a valid URI
My current ${user.home}
system variable points to C:\Users\Name.Surname\
and I even tried to update this system property during repl.jar launch with -D
parameter in batch script but for some reason this does not work:
%JAVA_HOME%\bin\java -Duser.home=C:/Users/Name.Surname/ -jar %PROJECT_DIR%\repl\appium-repl-0.1.0.jar
I found an issue on matteobaccan/owner#123 where described the same behavior, so update, please, org.aeonbits.owner
in your project dependencies to 1.0.9 version. I think it might help.
Hi,
really like this tool ๐ However, when using it with iOS / Xcode 10.1, currently I get the following error when using e.g. ios.source():
Calling AppiumDriver.execute() with args: ["var source = document.documentElement.outerHTML; \nif (!source) { source = new XMLSerializer().serializeToString(document); }\nreturn source;",[],"6cc6ee89-afbc-46dc-9669-5739b4c800a0"]
[XCUITest] Executing command 'execute'
[W3C (6cc6ee89)] Encountered internal error running command: NotImplementedError: Method is not implemented
[W3C (6cc6ee89)] at XCUITestDriver.extensions.execute (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/execute.js:13:11)
When changing the dependency on the appium java client to latest 7.0.0 and building the package by myself on my machine, this seems to solve the issue. Would it be possible to upgrade the appium java client here in the repo?
Thank you.
Cheers
Hello,
Is there a way to update the java-client to latest and then use it?
Thank You
java> ios.start("iPhone-7", "EE7A251E-1AEE-4BE1-AF41-77F616C00958", "/Users/kranthi/Library/Developer/Xcode/DerivedData/path/to/example.app", "http://0.0.0.0:4723/wd/hub", "1200")
is the command I gave and returned the result.
I have started Appium session before running the above command.
`ERROR: start(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) is not public in com.mobilebox.repl.commands.IOSCommands; cannot be accessed from outside package
ios.start("iPhone-7", "EE7A251E-1AEE-4BE1-AF41-77F616C00958", /Users/kranthi/Library/Developer/Xcode/DerivedData/path/to/example.app", "http://0.0.0.0:4723/wd/hub", "1200");
^
ERROR: start(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) is not public in com.mobilebox.repl.commands.IOSCommands; cannot be accessed from outside package
ios.start("iPhone-7", "EE7A251E-1AEE-4BE1-AF41-77F616C00958", /Users/kranthi/Library/Developer/Xcode/DerivedData/path/to/example.app", "http://0.0.0.0:4723/wd/hub", "1200");
^
ERROR: incompatible types: void cannot be converted to java.lang.Object
ios.start("iPhone-7", "EE7A251E-1AEE-4BE1-AF41-77F616C00958", /Users/kranthi/Library/Developer/Xcode/DerivedData/path/to/example.app", "http://0.0.0.0:4723/wd/hub", "1200");`
I want to create new session with installed app on Android
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.