Robotframework之Run Keyword And Return Status和Run Keyword
今天在android项目中遇到一个问题,场景达人每天第一次接单时,会弹出提示框:每日完成订单配送后将扣取1元保险费,是否确认接单?,点击确定后,才能接单成功,并且只有每天第一次接单才会弹出
如下图

此处要判断当前的接单是不是第一次接单,如果是第一次接单,点击确定,如果不是第一次接单,在接单页面点击接单后,直接接单成功,思路:
用Run Keyword And Return Status关键字判断页面是否有提示框弹出,如果有提示框弹出,用Run Keyword关键字执行点击确定按钮操作。
具体实现如下,页面有弹出框时,${popup_mess}变量值是True,没有值则为False

*** Settings ***
Library AppiumLibrary
Resource ../../元素资源/呼送APP/达人接单.txt *** Keywords ***
达人接单
Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=19 deviceName=127.0.0.1:62001 app=${CURDIR}${/}husong1.0.0_14.apk appPackage=com.husongtechnology.husong
... appActivity=com.hsdzkj.husong.ui.activity.IndexActivity unicodeKeyboard=True resetKeyboard=True #open application的时候最后面增加两个参数,input text支持中文输入
Wait Until Page Contains Element id=${接单} timeout=20 error=达人接单页面未加载成功 #等待达人接单页面显示
Click Element id=${接单} #点击接单按钮
Comment 如果是第一次接单,点击确定,不是第一次,接单成功
${popup_mess} Run Keyword And Return Status Page Should Contain Text 每日完成订单配送后将扣取1元保险费,是否确认接单?
Run Keyword If '${popup_mess}' == 'True' Run Keyword Click Element id=com.husongtechnology.husong:id/cancel
Robotframework之Run Keyword And Return Status和Run Keyword的更多相关文章
- Run Keyword And Ignore Error,Run Keyword And Return Status,Run Keyword And Continue On Failure,Run Keyword And Expect Error,Wait Until Keyword Succeeds用法
*** Test Cases ***case1 #即使错误也继续执行,也不记录失败,且可以返回执行状态和错误信息 ${Run Keyword And Ignore Error status} ${st ...
- RobotFrameWork(五)控制流之if语句——Run Keyword If
5.1 语句简介 robotframework中的if语句是使用关键字Run Keyword If来代替的 Run Keyword If 函数释义:如果给出的判断条件满足,就执行给出的关键字. 函数结 ...
- fabric报错:Fatal error: run() received nonzero return code 1 while executing!
今天在使用fabric远程安装rpm时,一直报:Fatal error: run() received nonzero return code 1 while executing! 这看起来也是没笔病 ...
- Compilation failed (return status=1): g++.exe: error: CreateProcess: No such file or directory错误
windows10上 theano安装之后出现的问题 >>> import theano You can find the C code in this temporary file ...
- mysql: 模糊查询 feild like keyword or feild like keyword , concat(feild1,feild2,feild3) like keyword
mysql: 模糊查询 feild like '%keyword%' or feild like'% keyword%' , 或者 concat(feild1,feild2,feild3) like ...
- vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [
这是因为,引用的插件在node_modules里,并不在vue-cli的es6编译范围内,所以语法报错,修改方法:
- RF新手常见问题总结
RF新手常见问题总结--(基础篇) 1. 经常有人问这个元素找不到,一般先排除这两个地方,再自己找找A:是否等待了足够的时间让元素加载 (增加sleep xx, wait Until xxx)B: ...
- RF新手常见问题总结--(基础篇)
1. 经常有人问这个元素找不到,一般先排除这两个地方,再自己找找A:是否等待了足够的时间让元素加载 (增加sleep xx, wait Until xxx)B: 仔细查查,这个元素是否进入到另一个f ...
- Run keyword if
Wait For Page Ready ${a} Run Keyword And Return Status Page Should Contain 新建 log ${a} Run Keyword I ...
随机推荐
- 洛谷P1021 邮票面值设计
题目描述 给定一个信封,最多只允许粘贴N张邮票,计算在给定K(N+K≤15)种邮票的情况下(假定所有的邮票数量都足够),如何设计邮票的面值,能得到最大值MAX,使在1-MAX之间的每一个邮资值都能得到 ...
- Couriers(bzoj 3524)
Description 给一个长度为n的序列a.1≤a[i]≤n.m组询问,每次询问一个区间[l,r],是否存在一个数在[l,r]中出现的次数大于(r-l+1)/2.如果存在,输出这个数,否则输出0. ...
- C#特性入门《详解》
原文发布时间为:2008-11-22 -- 来源于本人的百度文章 [由搬家工具导入] <转>http://www.bccn.net/Article/net/cs/jszl/200709/6 ...
- Two Sum(hashtable)
Given an array of integers, find two numbers such that they add up to a specific target number. The ...
- Hibernate学习笔记(三)
我是从b站视频上学习的hibernate框架,其中有很多和当前版本不符合之处,我在笔记中进行了修改以下是b站视频地址:https://www.bilibili.com/video/av14626440 ...
- Spring Boot应用的启动和停止(Spring Boot应用通过start命令启动)
Spring Boot,作为Spring框架对“约定优先于配置(Convention Over Configuration)”理念的最佳实践的产物,它能帮助我们很快捷的创建出独立运行.产品级别的基于S ...
- Spring Boot使用MyBatis 3打印SQL的配置
普通Spring下的XML文件配置: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE co ...
- JavaScript 中 for 循环
在ECMAScript5(简称 ES5)中,有三种 for 循环,分别是: 简单for循环 for-in forEach 在2015年6月份发布的ECMAScript6(简称 ES6)中,新增了一种循 ...
- 如何在不允许联网的环境下使用Maven开发
前言:Maven的运行机理是:Maven核心组件先去本地的.m2目录下的库中去寻找依赖或者插件,如果本地库里没有,如果配置了私服则上私服去下载依赖或者插件,如果私服上没有,则上中央服务等Maven服务 ...
- send-mail: fatal: parameter inet_interfaces: no local interface found for ::1
转载:http://blog.csdn.net/csdnones/article/details/50717934 发送邮件: [root@iZ23whn33jnZ log]# echo '这是邮件标 ...