受益匪浅,互帮互助~~
css 定位的优势?
css 在我理解中就是页面样式。。这个怎么会成为优势呢?请指教~~
#3 楼 @seveniruby 我表示我也在中软呆过。。。。叫你师哥吗 哈哈
#12 楼 @seveniruby 表示大脑有点捉急了。。。。这个错误是在 PAD 上出来的,我怎么把这些文字当到我的 MAC 上呀?
#9 楼 @lihuazhang
#10 楼 @seveniruby
尝试了好多次 ,还是又错误,不过这次不是在 appium,而是在我 app 的 webview 里出现了一个很长很长的错误,我觉得又点意义的就那个错误说明:illegal character in fragment at index 7903:....
下面就全部都是代码了。。很长很长
code:
DesiredCapabilities cap = new DesiredCapabilities();
WebDriver wd = null;
// cap.setCapability(CapabilityType.BROWSER_NAME, "");
cap.setCapability(CapabilityType.VERSION, "4.4.2");
cap.setCapability(CapabilityType.PLATFORM, "MAC");//iPhone Simulator iPad Device Selendroid
cap.setCapability("device", "selendroid");//
cap.setCapability("app", "/Users/administrator/Documents/sf.apk");//app.getAbsolutePath() chromium ContactManager /Users/administrator/Documents/ContactManager.apk Users/administrator/Documents/sf.apk
//cap.setCapability("launch", "true");
cap.setCapability("app-activity", ".activities.SFLoginActivity");//MainActivity .ContactManager .activities.SFAccountSelectActivity
cap.setCapability("app-package", "com.sharefile.mobile.tablet");//com.example.android.contactmanager
wd = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
wd = new Augmenter().augment(wd);
wd.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
// System.out.println(wd.getWindowHandles().size());
// for (String s : wd.getWindowHandles()) {
// System.out.println(s);
// wd = wd.switchTo().window(s);
// }
Thread.sleep(5000);
wd.switchTo().window("WEBVIEW");
//CScreenShot.takeScreenShot(wd, "/Users/administrator/Documents/AND/1-screenshot", "0");
// wd.findElement(By.xpath("//input[@type='text']")).click();
wd.findElement(By.xpath("//input[@type='text']")).sendKeys("123");
在 wd.findElement(By.xpath("//input[@type='text']")).sendKeys("123"); 这句的时候出错的
screenshot:
#7 楼 @seveniruby You are right! 改了后就解决了~可以顺利起来,然后我去尝试操作 WEBVIEW 里的内容又是一堆报错 我先研究下吧,不懂在上来问,THANKS!
#4 楼 @seveniruby 大神呀 这段代码是在 appium 哪个文件夹/文件下呀?
wo 换了低版本 de 也是这个错误
我的设备是 nexus7 4.4.2 版本的 难不成 shi 因为这个版本没法使用 selendroid?
要是这样的话 那我怎么测试 werbview 类型的呀?
这个问题 我根据 http://stackoverflow.com/questions/16619143/android-maven-could-not-find-tool-aapt 这个帖子 可以解决 但是又出了新的 error
error:
nfo: Using local app from desiredCaps: /Users/administrator/Documents/sf.apk
info: Creating new appium session 962652b6-1b4b-406f-a5c1-ee75ef25e39a
info: Starting selendroid server
info: Checking whether selendroid is built yet
info: Selendroid server exists!
info: Preparing device for session
info: Checking whether app is actually present
info: Checking whether adb is present
info: [ADB] Using adb from /Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb
info: Trying to find a connected android device
info: [ADB] Getting connected devices...
debug: executing: "/Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" devices
info: [ADB] 1 device(s) connected
debug: executing: "/Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 072008a5 wait-for-device
info: Setting device id to 072008a5
info: [ADB] Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: "/Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 072008a5 shell "echo 'ready'"
info: Starting logcat capture
debug: executing: "/Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb" -s 072008a5 uninstall com.sharefile.mobile.tablet.selendroid
info: Rebuilt selendroid apk does not exist, uninstalling any instances of it on device to make way for new one
info: Uninstalling com.sharefile.mobile.tablet.selendroid
debug: App was not uninstalled, maybe it wasn't on device?
info: Rebuilt selendroid server does not exist, inserting modified manifest
info: Inserting selendroid manifest
info: Checking whether aapt is present
error: Failed to start an Appium session, err was: Error: Required platform doesn't exist (API level >= 17)
info: [ADB] Using aapt from /Users/administrator/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/aapt
info: Compiling manifest /tmp/com.sharefile.mobile.tablet/AndroidManifest.xml
info: Cleaning up appium session
info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Required platform doesn't exist (API level >= 17))","origValue":"Required platform doesn't exist (API level >= 17)"},"sessionId":null}
POST /wd/hub/session 500 1277ms - 248b
debug: Appium request initiated at /wd/hub/status
info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.12.3","revision":"c8abd030c0cedcc387532f2aa986fd956e46eb4f"}}}
debug: Request received with params: {}
GET /wd/hub/status 200 1ms - 144b
debug: Appium request initiated at /wd/hub/status
info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.12.3","revision":"c8abd030c0cedcc387532f2aa986fd956e46eb4f"}}}
debug: Request received with params: {}
GET /wd/hub/status 200 1ms - 144b