Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否增加类似selenium中的By #127

Closed
caizhenxing opened this issue Aug 23, 2016 · 1 comment
Closed

能否增加类似selenium中的By #127

caizhenxing opened this issue Aug 23, 2016 · 1 comment
Labels

Comments

@caizhenxing
Copy link

  • Macaca Version:1.0.0
  • Operate System: mac
  • **programming Language: java
    之前我用appium时,封装过一个这样的方法,我传一个locator,不用关心它到底是xpath还是id,name,目前macaca java版,貌似必须得指定这个locator具体是id、name还是xpath,这样会写很多重复的代码,感觉不是很方便
    public By getBy(String locator) {
    if (locator.startsWith("//") || locator.startsWith("(")) {
    return By.xpath(locator);
    } else {
    return new ByIdOrName(locator);
    }
    }
@xudafeng xudafeng changed the title @达峰 能否增加类似selenium中的By 能否增加类似selenium中的By Aug 23, 2016
@xudafeng
Copy link
Member

@caizhenxing 为了与JS和Py的api命名一致,是时候丢弃上一代的习惯了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants