How to use groovy script on jenkins】的更多相关文章

1. Install groovy plugin 2. Add a step of groovy. (normal & systerm) 3. Execute groovy script import jenkins.model.* def q = Jenkins.instance.queue q.items.findAll{ it.task.name.startsWith('ttt') }.each{ q.cancel(it.task) } Above script is cancel all…
As you know the groovy script and java script language is the soapui supported .but unfortunately Soapui's groovy editor had not provided a better editor to write the groovy script. there are two approaches you can take to write your own groovy scrip…
https://support.smartbear.com/readyapi/docs/soapui/steps/groovy.html Get test case object To obtain the object which refers to the containing test case, use the following code snippet: Groovy   def case = testRunner.testCase;   By using the testCase …
$ cat Hello.java package test; public class Hello { public int myadd(int x, int y) { return 10 * x + y; } } $ cat myapp.groovy import test.Hello def hello = new Hello() println hello.myadd(13, 5) $ javac Hello.java $ mkdir test;mv Hello.class test $…
需求:以索引中的boostapp列作为评分的基础分值,同时根据carpublishtime(数据的刷新时间字段)按时间进行衰减. 基于Groovy脚本实现. 1.query脚本方式: { "fields": [ "boost", "ucarid", "boostapp", "carpublishtime" ], "query": { "function_score":…
1. Run special step: testRunner.runTestStepByName("stepName/requestName") get it's response: testRunner.testCase.testSteps["stepName/requestName"].testRequest.response 2.Set property def setProperties(Name,Value,Place) { name = Name; t…
log.info testRunner.testCase.testSuite.project.getActiveEnvironment().getName()…
def x = new String[3] x[0] = "A" x[1] = "B" x[2] = "C" log.info"XXXXXX 1" try{ x[3] = "D" // def z=9/0 }catch(Exception e){ log.info "Some error "+e.getMessage() // Use e.getMessage() to print ex…
Hashset: HashSet set = new HashSet() set.add("India") set.add("USA") set.add("China") log.info "Set size is : " + set.size() set.add("China") log.info "Set size is : " + set.size() Iterator iter…
Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" x[3] = "Japan" x[4] = "China" log.info "Size of list is " + x.size() log.info "The first item in list is : "+x[0]…