今天在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的更多相关文章

  1. 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 ...

  2. RobotFrameWork(五)控制流之if语句——Run Keyword If

    5.1 语句简介 robotframework中的if语句是使用关键字Run Keyword If来代替的 Run Keyword If 函数释义:如果给出的判断条件满足,就执行给出的关键字. 函数结 ...

  3. fabric报错:Fatal error: run() received nonzero return code 1 while executing!

    今天在使用fabric远程安装rpm时,一直报:Fatal error: run() received nonzero return code 1 while executing! 这看起来也是没笔病 ...

  4. 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 ...

  5. 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 ...

  6. vue2.x 在引用插件的时候,npm run dev跑正常 ,npm run build 报错vue-cli Unexpected token: punc (() [

    这是因为,引用的插件在node_modules里,并不在vue-cli的es6编译范围内,所以语法报错,修改方法:

  7. RF新手常见问题总结

    RF新手常见问题总结--(基础篇) 1. 经常有人问这个元素找不到,一般先排除这两个地方,再自己找找A:是否等待了足够的时间让元素加载 (增加sleep xx, wait Until xxx)B:  ...

  8. RF新手常见问题总结--(基础篇)

    1. 经常有人问这个元素找不到,一般先排除这两个地方,再自己找找A:是否等待了足够的时间让元素加载 (增加sleep xx, wait Until xxx)B:  仔细查查,这个元素是否进入到另一个f ...

  9. Run keyword if

    Wait For Page Ready ${a} Run Keyword And Return Status Page Should Contain 新建 log ${a} Run Keyword I ...

随机推荐

  1. [luoguP1227] [JSOI2008]完美的对称(sort)

    传送门 排序! #include <cstdio> #include <iostream> #include <algorithm> #define N 20001 ...

  2. 逆序对数列(BZOJ 2431)

    题目描述 对于一个数列{ai},如果有i<j且ai>aj,那么我们称ai与aj为一对逆序对数.若对于任意一个由1~n自然数组成的数列,可以很容易求出有多少个逆序对数.那么逆序对数为k的这样 ...

  3. TYVJ P 1214 硬币问题

    TYVJ  P 1214 硬币问题 时间: 1000ms / 空间: 131072KiB / Java类名: Main 描述   有n种硬币,面值为别为a[1],a[2],a[3]……a[n],每种都 ...

  4. poj3259,简单判断有无负环,spfa

    英语能力差!百度的题意才读懂!就是一个判断有无负环的题.SPFA即可.,注意重边情况!! #include<iostream> //判断有无负环,spfa #include<queu ...

  5. oracle alert 日志位置

    Oracle 11g Alert log 文件位置的问题 https://blog.csdn.net/yujin2010good/article/details/7690191 https://blo ...

  6. 前端学习之--html

    html 文件就是充当模板使用,包含head头和body身体,body包含众多的标签,每个标签都使用尖括号包裹,内部由标签名和标签属性构成.其中标签分为2类: 1:块级标签,特点:占用一行,如:< ...

  7. "格式太旧或是类型库无效。 (异常来自 HRESULT:0x80028019 (TYPE_E_UNSUPFORMAT))"

    错误提示内容: “System.Runtime.InteropServices.COMException (0x80028019): 格式太旧或是类型库无效. (异常来自 HRESULT:0x8002 ...

  8. POJ 3264 Balanced Lineup(RMQ_ST)

    题目链接:http://poj.org/problem? id=3264 Description For the daily milking, Farmer John's N cows (1 ≤ N  ...

  9. &quot;undefined reference to strptime&quot;之自己定义strptime函数

    简单介绍   strptime()函数可以依照特定时间格式将字符串转换为时间类型.简单点说可以将字符串时间转化为时间戳. 这个函数包括在time.h头文件里,在Unix或者类Unix系统中,我们会常常 ...

  10. mysql innodb插入意向锁

    innodb中有插入意向锁.专门针对insert,假设插入前,该间隙已经由gap锁,那么Insert会申请插入意向锁. 那么这个插入意向锁的作用是什么? 1.为了唤起等待.由于该间隙已经有锁,插入时必 ...