测试之家
  • Topics
  • QA
  • 招聘
  • 社区学堂新
  • 开源项目
  • 活动
  • Wiki
  • Sign Up
  • Sign In
新手
532589730 (Anson)
第 155 位Users / 2013-10-24
10 篇帖子 • 143 条回帖
2 关注者
0 正在关注
8 收藏
未设置 GitHub 信息.
  • 个人信息
  • 专栏
  • 话题
  • 回帖
  • 收藏
  • 关注中
  • 关注者
  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #36 楼 @tomzhangc
    那请慢读我 3 楼的回复。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #34 楼 @tomzhangc
    ...
    在 Xcode 上打开一项目,好像跑 simulator 时可以选 iOS simulator 设备的,里面就可以看到 iOS 有什么版本。
    Appium 会运行指定 Xcode 的最高版本的 iOS。

    另外一种方法是使用 ios-sim 查看默认 Xcode 的 iOS 版本。

    我也只会这两种笨方法。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #32 楼 @tomzhangc
    要看 iOS 版本的,我把 iOS 切换到 iOS6.x 后,driver.swipe() 马上可以滑动,就 4 楼代码,从右向左滑动。

  • python appium 编写测试用例时,发现不支持中文的对象识别,怎么办? at May 19, 2014

    试试在 python 源码中指定 utf-8

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #29 楼 @tomzhangc
    Appium 1.0 的 Java 的话,应该是
    private AppiumDriver driver;

    请参考 appium 的示例.
    https://github.com/appium/appium/tree/master/sample-code/examples/java/junit/src/test/java/com/saucelabs/appium

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #27 楼 @tomzhangc
    是的 1.0 的话,有 swipe 方法。
    至于怎么"激活" "mobile:",那得摸索下了。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #25 楼 @tomzhangc
    driver.swipe() 是 Appium 1.0 的方法来的,所以妳最好说明妳的 Appium 是什么版本的。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #21 楼 @seveniruby
    这个会报错的,原因是 duration 要 int 类型,是毫秒,除非自己改 Java-Client
    driver.swipe(75, 500, 75, 0, 0.8)

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    大概下面那样子吧,没验证。

    WebDriver driver;
    JavascriptExecutor js = (JavascriptExecutor) driver;
    
    HashMap<String, String> ScrollObject = new HashMap<String, String>();
    ScrollObject.put("direction", [Your direction string]);     //direction = "left", "right", "up", "down"
    this.js.executeScript("mobile: scroll", ScrollObject);
    
  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #16 楼 @tomzhangc
    妳的 scrollObject 是什么值?

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #13 楼 @seveniruby
    之前写的一个方法.

    public class iOSGesture {
        private WebDriver wd;
        private JavascriptExecutor js;
    
        public iOSGesture(WebDriver wd) {
            super();
            this.wd = wd;
            this.js = (JavascriptExecutor) this.wd;
        }
           public void scroll(String direction) throws InterruptedException{
            HashMap<String, String> ScrollObject = new HashMap<String, String>();
            ScrollObject.put("direction", direction);
            this.js.executeScript("mobile: scroll", ScrollObject);
            Common.sleep(1);
        }
    
    }
    
    
    

    direction 只有四个值: left, right, up, down。
    在 iOS7 上,是可以的。但无法拖拽一个 WebElement,从一个地方到另一个地方,但 Python 可以实现,在 iOS 7 上,之前我写过一贴子。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    看楼主的代码,应该还没切换到 appium 1.0 上,所以可以试试 mobile: scroll,虽然迟早要切换到 appium 1.x 上来。

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #9 楼 @seveniruby
    事实上,在 Appium 1.0 上还没有废弃。
    前段时间我在 google group 上问过 Jonathan Lipps,即 swipe 的问题,他说给 js 留了后门...
    但我没试怎么打开...

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    #5 楼 @tomzhangc
    使用 mobile: scroll

  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    另外,如果位置是取像素点的话,建议不要写像素,通过读取屏幕大小的方法获取座标。

    int X = driver.manage().window().getSize().getWidth();
    int Y = driver.manage().window().getSize().getHeight();
    
    int sX = (int) (X * 0.9);
    int sY = (int) (Y * 0.5);
    int eX = (int) (X * 0.05);
    int eY = sY;
    int duration = 1000;
    
    driver.swipe(sX, sY, eX, eY, duration);
    
  • ios 模拟器 执行滑动 看不到效果呢?求教。 at May 19, 2014

    swipe 被 Apple broken 了,在 iOS 7 simulator 上。

  • 大家帮个忙看下,使用 appium+maven+TestNG 来做自动化测试结果输出,运行 TestNG Test 之后,没有启动被测试程序。 at May 05, 2014

    我用的,修改自官方的 testng 的 pom,更新了 appium 1.0 的依赖,应该很多用不到的,里面有参数

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.xx.qa</groupId>
      <artifactId>xxxx</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>xxxx</name>
      <url>http://maven.apache.org</url>
    
      <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.8</version>
                <!--scope>test</scope-->
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>LATEST</version>
                <!--scope>test</scope-->
            </dependency>
            <dependency>
                <groupId>com.googlecode.json-simple</groupId>
                <artifactId>json-simple</artifactId>
                <version>1.1</version>
                <!--scope>test</scope-->
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
                <!--scope>test</scope-->
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.16</version>
            </dependency>
            <dependency>
                <groupId>com.saucelabs</groupId>
                <artifactId>sauce_testng</artifactId>
                <version>1.0.19</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>1.8</version>
            </dependency>
            <dependency>
                <groupId>org.jyaml</groupId>
                <artifactId>jyaml</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                 <groupId>io.appium</groupId>
                <artifactId>java-client</artifactId>
                <version>1.0</version>
            </dependency>
      </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <testFailureIgnore>true</testFailureIgnore>
                        <systemProperties>
                            <property>
                                <name>var1</name>
                                <value>${var1}</value>
                            </property>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    
        <repositories>
            <repository>
                <id>saucelabs-repository</id>
                <url>https://repository-saucelabs.forge.cloudbees.com/release</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    
    </project>
    
  • Eclipse 安装 Pydev 插件问题 at May 05, 2014

    直接在 marketplace 里面搜索安装,就可以了。

  • Appium 1.0 正式版发布 at May 05, 2014

    看了下范例,testng 的代码消失了。
    最多范例的还是 python 语言。

  • [求助] 在 iOS7 上实现 Drag and Drop 动作 (in Java) at April 30, 2014

    #7 楼 @lihuazhang
    还没解决,呵呵
    有空再看看 jsonwp 协议

  • [求助] 在 iOS7 上实现 Drag and Drop 动作 (in Java) at April 30, 2014

    #5 楼 @vigossjjj
    呵呵

  • [求助] 在 iOS7 上实现 Drag and Drop 动作 (in Java) at April 22, 2014

    #3 楼 @vigossjjj
    简单的左划右划是可以实现,类似下面

     swipeObject.put("direction", "right");
    js.executeScript("mobile: scroll",  swipeObject);
    
  • SVN+Jenkins+Maven+Appium+TestNG+ReportNG 实战 Android 自动化测试 at April 22, 2014

    #7 楼 @zhouxiaoyagirl
    还没用,主要是卡在 java 在 ios7 拖不动元素。

  • [求助] 在 iOS7 上实现 Drag and Drop 动作 (in Java) at April 16, 2014

    anybody here?

  • SVN+Jenkins+Maven+Appium+TestNG+ReportNG 实战 Android 自动化测试 at April 09, 2014

    学习了,考虑使用 testng+maven+appium 的整合工具

  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • 关于 / 活跃用户 / 中国移动互联网测试技术大会 / 反馈 / Github / API / 帮助推广
    TesterHome社区,测试之家,由众多测试工程师组织和维护的技术社区,致力于帮助新人成长,提高测试地位,推进质量发展。Inspired by RubyChina
    友情链接 WeTest腾讯质量开放平台 / InfoQ / 掘金 / SegmentFault / 测试窝 / 百度测试吧 / IT大咖说
    简体中文 / 正體中文 / English

    ©testerhome.com 测试之家   渝ICP备2022001292号
      渝公网安备 50022202000435号    版权所有 © 重庆年云聚力信息技术有限公司