• 受益匪浅,互帮互助~~

  • Appium 公开课 问题交流 at December 28, 2013

    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