测试之家
  • 社区
  • 问答
  • 招聘
  • 社区学堂新
  • 开源项目
  • 活动
  • Wiki
  • 注册
  • 登录
会员
neyo (songz)
第 4365 位会员 / 2015-07-10
2 篇帖子 • 359 条回帖
16 关注者
48 正在关注
539 收藏
to be a qualified tester
GitHub Public Repos
  • appium 0

    :iphone: Automation for iOS and Android Apps.

  • pipelineTest 0

  • simple-maven-project-w... 0

    A Maven project that just has some test failures (and skips) at random, to demonstrate result rep...

  • Python-100-Days 0

    Python - 100天从新手到大师

  • SJTU-Courses 0

    上海交通大学课程资料分享

  • json-server 0

    Get a full fake REST API with zero coding in less than 30 seconds (seriously)

  • cypress 0

    Fast, easy and reliable testing for anything that runs in a browser.

  • traefik 0

    The Cloud Native Edge Router

  • zero 0

    Zero is a web server to simplify web development.

  • Micro8 0

    Gitbook

More on GitHub
  • 个人信息
  • 专栏
  • 话题
  • 回帖
  • 收藏
  • 关注中
  • 关注者
  • 就某微信公众号抄袭 mrbug 团队所发文章一事做出官方声明 at 2016年03月17日

    金阳光。。。测试届的笑话了

  • 切换到 webview,查找元素失败后,不能截图 at 2016年03月17日

    #3 楼 @hello 没改对,你看我楼上回复。。

  • 切换到 webview,查找元素失败后,不能截图 at 2016年03月17日

    #4 楼 @a3096556718 代码带上 markdown 格式。。编辑框右边自己点点看

  • 切换到 webview,查找元素失败后,不能截图 at 2016年03月17日
    @user1hod_screen_args()
        def test_AA(self):
            invest_list =accountPage.Account(self.driver)
            username = login_cls[0][2]
            password = login_cls[0][3]
            logger.info('begin login app')
            invest_list.click_tab_me()
            loginButton = invest_list.is_element_exists(By.ID,u'com.yingzt.invest:id/summit_btn')
            if loginButton:
                login(self,username, password)
            else:
                pass
            invest_list.click_my_invest()
            sleep(2)
            context = self.driver.contexts
            self.driver.switch_to.context(u'WEBVIEW_com.yingzt.invest')
            invest_list.click_invest_list()
            sleep(2)
            hh = self.driver.window_handles
            sleep(2)
            self.driver.switch_to_window(hh[1])
            invest_list.click_invest_contract()
    

    #4 楼 @a3096556718

  • 切换到 webview,查找元素失败后,不能截图 at 2016年03月17日

    markdown 改下。。你这贴要被关小黑屋了

  • Appium 跑用例,点击收藏,如何识别 toast 弹框已收藏,求大神指导 at 2016年03月17日

    #3 楼 @zsd https://testerhome.com/topics/2715帖子好好看看

  • Appium 跑用例,点击收藏,如何识别 toast 弹框已收藏,求大神指导 at 2016年03月17日

    既然知道是 toast 的,在论坛搜搜看不就知道了

  • 计算机开放电子书汇总 at 2016年03月17日

    这帖子持续关注了,赞一个

  • [杭州] 阿里巴巴招聘 资深测试开发工程师 2 名 at 2016年03月16日

    mads 又把楼歪了😄

  • [已解决] 关于 appium 中的 xpath 定位元素问题 at 2016年03月15日

    #4 楼 @johnwrite 控件层级问题。你点了文本,周围也可以点的

  • Xposed 获取微信用户名密码演示 at 2016年03月14日

    前排支持 q 博

  • appium 跑用例时的疑惑 (测试用例的代码是和 appium 运行时的代码写在一起放在一个类里,还是测试的代码单写一个 py 文件,appium 要测试的时候导入呢) at 2016年03月14日

    #15 楼 @enumerate robotframework-appiumlibrary 是这样封装的:

    def click_element(self, locator):
        """Click element identified by `locator`.
    
        Key attributes for arbitrary elements are `index` and `name`. See
        `introduction` for details about locating elements.
        """
        self._info("Clicking element '%s'." % locator)
        self._element_find(locator, True, True).click()
    

    将 locator 参数(name=xxx,id=xxx)传入_element_find 方法定位元素

    def _element_find(self, locator, first_only, required, tag=None):
        application = self._current_application()
        elements = self._element_finder.find(application, locator, tag)
        if required and len(elements) == 0:
            raise ValueError("Element locator '" + locator + "' did not match any elements.")
        if first_only:
            if len(elements) == 0: return None
            return elements[0]
        return elements
    

    _element_finder 是 class ElementFinder 的实例,有如下定位策略

    def __init__(self):
        self._strategies = {
            'identifier': self._find_by_identifier,
            'id': self._find_by_id,
            'name': self._find_by_name,
            'xpath': self._find_by_xpath,
            'class': self._find_by_class_name,
            'accessibility_id': self._find_element_by_accessibility_id,
            'android': self._find_by_android,
            'ios': self._find_by_ios,
            'css': self._find_by_css_selector,
            None: self._find_by_default
        }
    
    

    通过_parse_locator(locator) 获取到定位策略和定位标准,调用 strategies 内定义的定位方法

    def find(self, browser, locator, tag=None):
        assert browser is not None
        assert locator is not None and len(locator) > 0
    
        (prefix, criteria) = self._parse_locator(locator)
        strategy = self._strategies.get(prefix)
        if strategy is None:
            raise ValueError("Element locator with prefix '" + prefix + "' is not supported")
        (tag, constraints) = self._get_tag_and_constraints(tag)
        return strategy(browser, criteria, tag, constraints)
    

    _parse_locator(locator) 对传入的定位策略 id=xxx,name=xxx 进行解析,=号前面的是定位方法,后面的是定位标准。

    def _parse_locator(self, locator):
        prefix = None
        criteria = locator
        if not locator.startswith('//'):
            locator_parts = locator.partition('=')
            if len(locator_parts[1]) > 0:
                prefix = locator_parts[0].strip().lower()
                criteria = locator_parts[2].strip()
        return (prefix, criteria)
    
  • 使用 Appium 简单模拟 Wechat (Android) 登录 at 2016年03月14日

    #7 楼 @wut0n9 第一段的文档也有问题,api16 应该是支持的

  • 使用 Appium 简单模拟 Wechat (Android) 登录 at 2016年03月14日

    #7 楼 @wut0n9 嗯,第二段的意思是 selendroid 测 4.4 以下的 webview。webview 方面各版本我就没验证过,不知道啦

  • (已解决) appium+python:关于按键的长按问题 long_press at 2016年03月14日

    #8 楼 @kesha0 tap+duration 其实调用的就是 long_press

  • 使用 Appium 简单模拟 Wechat (Android) 登录 at 2016年03月14日

    #5 楼 @wut0n9 拿 ui automator viewer 找元素的时候,4.1 以下会报错的需要 api16+ 的错误的。我记得我跑 api16 还是 17 的时候,用 appium 模式是可以跑的😄

  • appium 跑用例时的疑惑 (测试用例的代码是和 appium 运行时的代码写在一起放在一个类里,还是测试的代码单写一个 py 文件,appium 要测试的时候导入呢) at 2016年03月14日

    #11 楼 @enumerate def click_element(self,locator): 你是想要这样的封装吗?

  • 使用 Appium 简单模拟 Wechat (Android) 登录 at 2016年03月14日

    挺好的入门帖,下次再被问这样的问题就直接贴你的帖子了😄有一点错误指出下啊
    Android
    Mac OSX 10.7+ or Windows 7+ or Linux
    Android SDK ≥ 16 (SDK < 16 in Selendroid mode)
    应该是 4.1 以下需要使用 selendroid 模式

  • python send_keys () 方法 at 2016年03月13日

    #8 楼 @monkey 好哒猴总我改一下

  • [杭州] 阿里巴巴招聘 资深测试开发工程师 2 名 at 2016年03月12日

    @mads 快去

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

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