Giter Site home page Giter Site logo

Comments (5)

tsj1107 avatar tsj1107 commented on August 22, 2024

waitForElementByXPath sendKeys 等都是 driver 上的方法,el 上是不存在的

from macaca.

xudafeng avatar xudafeng commented on August 22, 2024

https://github.com/mattdesl/promise-cookbook 进阶推荐

from macaca.

TediWang avatar TediWang commented on August 22, 2024

非常感谢 @xudafeng @tsj1107 ,promise语法熟悉了一下。
case调整了一下,能正常判断是否登陆并执行相应的逻辑。
Case代码:

return driver
          .elementByName('我  的')
          .tap()
          .elementByNameOrNull('登录/注册')
          .then(function(el){
            if(el){
              return driver.elementByName('登录/注册')
                     .click()
                     .waitForElementByXPath('//UIATextField[1]')
                     .sendKeys('123456')
                     .waitForElementByXPath('//UIASecureTextField[1]')
                     .sendKeys('123')
                     .sleep(1000)
                     .sendKeys('\n')
                     .sleep(5000)
                     .takeScreenshot();
            }else{
              return driver
               .elementByName('首  页')
               .tap();
            }
          });

from macaca.

xudafeng avatar xudafeng commented on August 22, 2024

@TediWang 💯

from macaca.

septem123 avatar septem123 commented on August 22, 2024

安卓的各种element方法和hasElement方法 只要找不到元素 直接就抛异常 了 根本没有后面的处理

from macaca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.