import com.eviware.soapui.support.GroovyUtils

def groovyUtils = new GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "checkProgressOfRunExport#ResponseAsXml" ) //Check whether the data is null or it doesn't contains state
def data = holder.getNodeValue("//data[1]/text()") //If the running status is not 1 after 3 minutes, it means the test step timeout
def waitingTime = Integer.parseInt(context.expand('${#TestCase#runningTime}'))
log.info "The running time is : " + waitingTime +"s"
if(waitingTime == 180){
testRunner.testCase.setPropertyValue("runningTime", "0")
assert false, "Wait to run export, time is out after 3 minutes"
} //Parse running status
def status = "1"
if((data!=null)&&(data.indexOf("running")!=-1)){
status = data.split("running=\"")[1].split("\"")[0]
log.info "The running status is : "+status
} //Run the step [checkProgressOfRunExport] every 2 seconds
if(status!="0"){
waitingTime+=2
testRunner.testCase.setPropertyValue("runningTime", waitingTime.toString())
sleep(2000)
testRunner.gotoStepByName("checkProgressOfRunExport")
}else{
//Set the running time to default value "0"
testRunner.testCase.setPropertyValue("runningTime", "0")
}

  

[SoapUI] 设置最大等待时间,不断重复的去发送一个request,每次从response中获取一个status,直到这个status从一种状态变成另外一种状态的更多相关文章

  1. 现在有一个城市销售经理,需要从公司出发,去拜访市内的商家,已知他的位置以及商家的位置,但是由于城市道路交通的原因,他只能在左右中选择一个方向,在上下中选择一个方向,现在问他有多少种方案到达商家地址。给定一个地图map及它的长宽n和m,其中1代表经理位置,2代表商家位置,-1代表不能经过的地区,0代表可以经过的地区,请返回方案数,保证一定存在合法路径。保证矩阵的长宽都小于等于10。

    include "stdafx.h" #include<iostream> #include<vector> #include<algorithm&g ...

  2. 剑指offer35题:第一个只出现一次的字符+剑指offer55题:字符流中第一个不重复的字符+剑指offer51题:数组中重复的数字

    在看剑指offer的时候,感觉这三个题目很像,都是用哈希表可以解决,所以把这三个题整理出来,以供复习. 剑指offer35题:第一个只出现一次的字符 题目描述:在字符串中找出第一个只出现一次的字符.如 ...

  3. [转载]Css设置table网格线(无重复)

    原文地址:Css设置table网格线(无重复)作者:依然贰零零柒 效果图: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transition ...

  4. elasticsearch的store属性跟_source字段——如果你的文档长度很长,存储了_source,从_source中获取field的代价很大,你可以显式的将某些field的store属性设置为yes,否则设置为no

    转自:http://kangrui.iteye.com/blog/2262860 众所周知_source字段存储的是索引的原始内容,那store属性的设置是为何呢?es为什么要把store的默认取值设 ...

  5. 论 Java 中获取一组不重复的随机数之性能问题

    今天在做一个Java项目, 用到了使用一组不重复的随机数问题, 不管怎么做随机数里面总有几个是重复的. 于是上网去找资料, 在网上找到的资料中大部分都是一个思路: 网上的思路一:(性能不理想) 先生成 ...

  6. Disruptor多个消费者不重复处理生产者发送过来的消息

    1.定义事件事件(Event)就是通过 Disruptor 进行交换的数据类型. package com.ljq.disruptor; import java.io.Serializable; /** ...

  7. 如何在 messager/alert/confirm等消息提示框中 获取 / 设置 嵌入 html内容中的 input[type=checkbox]等的选中状态?

    总结, 有3点: 不能/不要 在 这些消息框 / 提示框/ 对话框中的 回调函数中去写代码: 获取嵌入 内容中input.checkbox的选中状态, 因为 虽然在这些框存在的时候, 这个 check ...

  8. 你有没有觉得邮件发送人固定配置在yml文件中是不妥当的呢?SpringBoot 动态设置邮件发送人

    明月当天,不知道你有没有思念的人 前言 之前其实已经写过SpringBoot异步发送邮件,但是今天在一个小项目中要用到发送邮件时,我突然觉得邮件发送人只有一个,并且固定写在yml文件中,就是非常的不妥 ...

  9. java中获取接口(方法)中的参数名字(eclipse设置编译参数)(java8 javac -parameters)

    interface接口参数 jdk1.7及以前使用spring功能实现的: 注意: 1.该功能只能获取类的方法的参数名,不能获取接口的方法的参数名. public static void test() ...

随机推荐

  1. 转载 深入理解java类加载器

    1 基本信息 每个开发人员对java.lang.ClassNotFoundExcetpion这个异常肯定都不陌生,这背后就涉及到了java技术体系中的类加载.Java的类加载机制是技术体系中比较核心的 ...

  2. c++官方文档-class

    #include <iostream> using namespace std; class Circle { double radius; public: Circle(double r ...

  3. 二维数组 cudaMallocPitch() 和三维数组 cudaMalloc3D() 的使用

    ▶ 使用函数 cudaMallocPitch() 和配套的函数 cudaMemcpy2D() 来使用二维数组.C 中二维数组内存分配是转化为一维数组,连贯紧凑,每次访问数组中的元素都必须从数组首元素开 ...

  4. 11.使用ForwardAction实现页面屏蔽。

    转自:https://wenku.baidu.com/view/84fa86ae360cba1aa911da02.html 我们在jsp页面之间写链接总会是.../xxx.jsp,而如果我们想屏蔽掉具 ...

  5. DataSnap Server HTTP json格式修改 返回图片

    DataSnap Server HTTP json 格式修改  http://127.0.0.1:8080/datasnap/rest/TServerMethods1/EchoString/hello ...

  6. MS sql 无法进行事务日志备份

    问题出在:恢复模型没有设置好我们之所以要备份数据库和事务日志都是为了以防万一,用来恢复.还原数据库的,因此恢复模型必须设置好,在sql server中默认的恢复模型为"简单".一般 ...

  7. Error 2503 and 2502 when installing/uninstalling on Windows 10

    1. Hold Ctrl+Shift and press Esc. 2. Locate “Windows Explorer” under “Windows processes”, now right ...

  8. github上关于iOS的各种开源项目集合(转)

    UI 下拉刷新 EGOTableViewPullRefresh - 最早的下拉刷新控件. SVPullToRefresh - 下拉刷新控件. MJRefresh - 仅需一行代码就可以为UITable ...

  9. Kotlin语言学习笔记(6)

    运算符重载(Operator overloading) 一元运算符 Expression Translated to +a a.unaryPlus() -a a.unaryMinus() !a a.n ...

  10. Ansiable Manage MySQL global variables

    mysql_variables - Manage MySQL global variables New in version 1.3. Synopsis Requirements (on host t ...