Appium robot framework 中关键字是怎么和函数对应起来的

luckyhey · 2018年08月12日 · 最后由 luckyhey 回复于 2018年10月23日 · 1422 次阅读

例如关键字 OpenApplication 是怎么样和 C:\Python27\Lib\site-packages\AppiumLibrary\keywords_applicationmanagement.py 中的 def open_application(self, remote_url, alias=None, **kwargs):函数对应起来的。它们的大小写不一致,而且函数名在 open 和 application 之间有个下划线_,谢谢!

共收到 4 条回复 时间 点赞
在路上 回复

class KeywordRecommendationFinder(object):

def init(self, user_keywords, libraries, resources):
self.user_keywords = user_keywords
self.libraries = libraries
self.resources = resources

def recommend_similar_keywords(self, name):
"""Return keyword names similar to name."""
candidates = self.get_candidates('.' in name)
normalizer = lambda name: candidates.get(name, name).lower().replace(
'
', ' ')
finder = RecommendationFinder(normalizer)
return finder.find_recommendations(name, candidates)

看懂框架的源码就明白了哈,纸上得来终觉浅,还是要自己去读代码

刷帖让大神看到

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册