Questions tagged [groovyscriptengine]

The tag has no usage guidance.

groovyscriptengine
Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

How to export statistics from SoapUI load test via groovy script?

I have a working project with load test. def loadTest = testRunner.testCase.testSuite.project.getTestSuiteByName("Load").getTestCaseByName(testCaseSelect).getLoadTestByName(loadTestSelect) ...
marecki's user avatar
  • 15
0 votes
1 answer
41 views

How to concatenate elements of list in a new line in flat file in Groovy script

I am trying to get all the values from following xml into one string splitted by "|" <n0:SendData xmlns:n0="http://testdata/" xmlns:soap-env="http://...
user22946701's user avatar
0 votes
1 answer
69 views

Groovy script to break payload for every date between start and end dates [closed]

I have an input like this: <root> <results> <loc>Loc 10</loc> <loc_name>Loc Desc10</loc_name> <points>3</points> <StartDate>2023-...
N21RL's user avatar
  • 31
0 votes
2 answers
80 views

Groovy Script to convert deep CSV to JSON

I have a groovy script that converts flat file CSV with Headers, Line items and Footer into a JSON. I am using a simple code as shown below but its not giving me the desired output. My expectation is ...
Arkesh Sharma's user avatar
-3 votes
1 answer
33 views

Regular expression: Combining two regex inside replaceAll() function in groovy

I have some test data which looks like below: test_ids = [test_data_123, test_123, test_data_456] I'm trying to pass them inside the replaceAll() method in Groovy, which will convert all the elements ...
Gomathy Balakrishnan's user avatar
-1 votes
1 answer
42 views

Unable to add Long values in Groovy

Unable to add Long values in Groovy. When we sum, it is not adding value after decimal. Long val1 = makeNullZero(getCustomFieldValue('Benefit 1 Annual $')); Long val2 = makeNullZero(...
Amit Singh's user avatar
3 votes
2 answers
617 views

How to load groovy scripts from within the jar file?

I am using groovy to execute a set of groovy scripts, which works fine when the runtime jar is deployed with the webapp and the runtime executes the groovy scripts present under C:\jboss-eap-7.4\bin (...
Ricky's user avatar
  • 324
0 votes
0 answers
197 views

How can I format a double in CPI groovyscript?

I have a requirement to convert a salary value: 100000 into 1,000.00. Salary is in double data type. I am using Groovy Script in this project but I have zero knowledge on how to use it. I am not sure ...
Lloyd Albert Tongco's user avatar
0 votes
0 answers
254 views

Groovy - How to print all variables in scope of script engine?

I am building workflows using a proprietary engine leveraging Flowable. The engine comes with preloaded beans that can be used from groovy script tasks and I would like to introspect all variables in ...
Arthur Burkhardt's user avatar
1 vote
2 answers
286 views

Groovy access script variable from application

Need to access the variable defined in the groovy script file Before executing the script using GroovyShell However, I am getting error: groovy.lang.MissingPropertyException: No such property: ...
Hexgear's user avatar
  • 318
0 votes
0 answers
278 views

Class.forName() not working in Groovy-Script

When using Class.forName() in the Groovy-Script of an IntelliJ-Live-Template-Variable always the name of the determined class is returned and the execution of the remaining code is stopped. This ...
Nico S.'s user avatar
  • 87
2 votes
1 answer
139 views

Groovy: how to override time unit of @TimedInterrupt in an ASTTransformationCustomizer?

I'm using Groovy 4.0.2 as a runtime scripting environment for my application. My goal is to introduce timeout handling into user-provided scripts, but depending on what the script is used for, ...
Martin Häusler's user avatar
0 votes
1 answer
2k views

How to get file names in a directory using groovy script?

I want to make a list of all the files present in a directory, using groovy. What would a good code to do the task? Thanks in Advance.
Yash's user avatar
  • 11
0 votes
0 answers
126 views

Run macro/ VBA using Groovy Script from SoapUI

I have my Soap UI execution details logged in csv file which is generated after suite execution using Grrovy script. I have a macro/vba code which generates report based on the data in csv file. I am ...
Sandeep Dhamale's user avatar
-1 votes
1 answer
168 views

Jenkins file groovy issues

Hi My jenkins file code is as follows : I am basically trying to make call to a python script and execute it, I have defined some variables in my code : And when i am trying to run it, It gives no ...
Legitimate_Figure_4430's user avatar
-2 votes
1 answer
652 views

How can i make requests in a loop in ReadyAPI with different data and response should be generated in another file?

I have a request body in ReadyAPI project. I have different data for a particular field in Request Body. Is there a way how I can loop the request with different data each time? the goal is to have a ...
jaydeep tewary's user avatar
-1 votes
1 answer
259 views

I need help in groovy script nested array

I need to loop over the below Json array and transform the data into the expected output. However, I am facing problem in looping over the nested array. input : [{"DomainName":"...
mohammmed sohail 's user avatar
1 vote
1 answer
1k views

extending java.lang.String in groovy script

i've a rather complex problem. I'am currently developing a a little groovy based script language for an ERP System. The functions and syntax of "my" script language are based on the already ...
Michael Rothenbücher's user avatar
0 votes
1 answer
2k views

What is the right way to compare two strings in SoapUI with groovy script assertion?

I need to compare two strings in SoapUI. The first one is from a text file stored in my local directory, and the second one is from an XML response I get from a REST API operation. Before comparing ...
catreedle's user avatar
1 vote
0 answers
168 views

IntelliJ IDEA LiveTemplate auto increment between usages

I am trying to make my life easier with Live Templates in intelliJ I need to increment some param by 1 every-time I use the snippet. So I tried to develop some groovyScript, and I am close, but my ...
Noyloy's user avatar
  • 134
-1 votes
2 answers
805 views

How to read a text file line by line define a count function using groovy script engine in jmeter

I have a text file contains 45 lines. I need to read the text file line by line based on the counter increment function. Example: If we read the first line of a line then it prints count value is 1 ...
chinna's user avatar
  • 55
2 votes
0 answers
411 views

How to Store the Compiled Groovy Script in Database and can be fetched when needed?

I have an application which use the same groovy script for multiple times. Everytime, it compiles the same script again and again during runtime. In order to improve the performance, I need to compile ...
Monisha Govindasamy's user avatar
-1 votes
1 answer
1k views

How to send an email using groovy script in Soap UI?

I want to send an automated email once all my test steps are passed in SOAP UI, using a groovy script test step?? Is there a way that we can achieve this ??
Anvesh Chowdary's user avatar
1 vote
0 answers
2k views

groovy.lang.MIssingPropertyException: No such property: testRunner for class:

I have previously tested this code on its own, once moving it into my class it breaks and gives me the error. groovy.lang.MIssingPropertyException: No such property: testRunner for class: csvConsume ...
Cylus's user avatar
  • 11
0 votes
1 answer
1k views

Groovy Script Deleting a row if it contains a certain value in a csv file

I am trying to come up with a way to delete a row in a CSV if it contains a certain value and not sure what structure is best to use? I would like to read the file into memory and store it in a ...
Cylus's user avatar
  • 11
0 votes
1 answer
776 views

How to trigger list of jenkins jobs sequentially in a loop

I am new to Groovy DSL, I am getting a list of successful jenkins job names from a script which satisfies my condition which will vary on each execution, EX1: JOB_A,JOB_B.. EX2: JOB_C,JOB_Y...I need ...
Karthik Reddy's user avatar
-1 votes
1 answer
692 views

Could anyone help me in understanding the groovy script below

I am trying to decode some groovy script. I was able to figure out that it is a regular expression but couldn't figure out what the code is exactly. def dirNumber = this.'Directory Number' dirNumber?"...
Ravindra varma Kanumuri's user avatar
0 votes
1 answer
1k views

How to correctly write groovy script in assertion to decode response and recive it in pdf?

I'm trying to receive pdf document with conent from 'rest request' respons via assertion script. I was trying in few ways, but for each of them the result was diffrent then expected. Could you ...
Matelko's user avatar
  • 15
2 votes
1 answer
3k views

How to mock groovy class that is used in script?

I have some generator classes, that are used in my custom steps in Jenkins Pipeline. I would like to test those steps (which are groovy scripts), together with mocking classes that are used inside. ...
kaskader's user avatar
-1 votes
1 answer
2k views

Groovy string parsing by ignoring "$" or any character(ps: no control over input data)

I am trying to replace a particular word say password to ******* from a string which has characters such as $ and \n in Groovy. I cannot escape them by using \ because i have no control over data i ...
Rohan's user avatar
  • 3
0 votes
1 answer
1k views

How can I pass the output from groovy script to the soap request

I am new to SoapUI and writing groovy scripts. In my request parameters, I have two fields "from and to". from is the current date and to is one year later date. so I have written a groovy script to ...
dp1005's user avatar
  • 1
0 votes
1 answer
306 views

How to replace variable inside ternaryoperation using groovy script engine

I am using Groovy SimpleTemplateEngine to set values dynamically at run time. I am using ternary operator as well inside the string. Values are not getting updated for the variables inside the ternary ...
narendra madasu's user avatar
0 votes
2 answers
48 views

`null` returned in groovy counter using while (soapui groovyscript)

The below code returns a null at the end of the list, which i'm sure is going to give me issues later on. Does anyone know why? I'm sure I'm not understanding something about how this language works :(...
imp's user avatar
  • 436
0 votes
1 answer
1k views

org.codehaus.groovy.GroovyBugError: BUG! exception in phase 'semantic analysis' in elasticsearch 5.6.10 cluster log

I am executing from my java application the following code using elasticsearch java api 5.6.10, I am execute an update using and use the groovy script inline bulkRequest.add( ...
Andres Benavides's user avatar
1 vote
1 answer
442 views

Groovy script won't run due to NoClassDefFoundError

I wrote a very simple groovy script to test if a cron expression is valid: import hudson.scheduler.CronTabList try { def cron = CronTabList.create("@daily") println("Valid cron!") } catch(...
George Cimpoies's user avatar
0 votes
2 answers
1k views

Groovy script to execute remote shell command

I am trying to execute a remote shell command using groovy script in jenkins console. Can you please let me know a proof of concept as how i can connect to the remote server and execute a shell ...
user1880732's user avatar
-1 votes
1 answer
837 views

How to call Groovy script from Scala?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <facts> <fact id="ItemPrice" displayName="Item Price"> <defaultValue>0</defaultValue> <script&...
Sujith AK's user avatar
  • 151
1 vote
1 answer
459 views

How to replace tinkerpop imports by janus-graph imports during initialization of gremlin groovy script engine?

I initialize gremlin-script-engine with janus-plugin in this way: GremlinScriptEngineManager engineManager = new DefaultGremlinScriptEngineManager(); engineManager.addPlugin(JanusGraphGremlinPlugin....
palandlom's user avatar
  • 549
3 votes
1 answer
621 views

Append CompiledScript or add two CompiledScript

Hello I'm using Groovy engine to eval a certain script. The problem is that the execution time is a little bit big, so I want to separate my script into two scripts. The first one is static and can be ...
Mehdi Bouzidi's user avatar
3 votes
1 answer
406 views

Class that implements trait with annotated field loses annotation on trait field if annotation contains closure field

#!/usr/bin/env groovy import java.lang.annotation.Retention import java.lang.annotation.RetentionPolicy @Retention(RetentionPolicy.RUNTIME) @interface AnnotationWithClosure { Class closure() ...
Iaroslav Churinov's user avatar
0 votes
1 answer
1k views

Groovy script returns null

Java file : public class TestModule{ @WrapToScript public Integer test() final Object params) { return 10; } } I will include the above class ...
Subitsha's user avatar
1 vote
1 answer
622 views

SoapUI Mock. How to select response relying on tag value in request

I have SOAP request looks like this: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gd="http://test.com/gds-mvmnt"> <env:Header/> <env:...
XVII's user avatar
  • 11
2 votes
1 answer
4k views

Create instances of java class using Groovy script

I am using Groovy script and Java, I am new to the subject. I am trying to create multiple instances of a java class (A) from groovy script and pass them to list, then pass this list to a new class (B)...
Ggdw's user avatar
  • 2,639
0 votes
2 answers
673 views

Groovy - No signature of method

I am new to groovy scripting and currently I am working on a script which works as an addon for Atlassian Jira. The script was working fine in the older version, but we had upgraded Jira to version 7 ...
invinci's user avatar
0 votes
1 answer
6k views

Elasticsearch : No field found in mapping while executing custom score script

I've been struggling with this issue for hours now. I am trying to implement custom score in my search using script score (groovy). Mapping : { "properties": { "m_skill": { "properties"...
Darth Shekhar's user avatar
0 votes
1 answer
979 views

Optional parameter in Groovy Script

I have a script that simply does // TODO: assign default value if not defined println optionalParameter When I invoke it using: new GroovyShell(new Binding([optionalParameter: 'text'])).evaluate(...
Michal Kordas's user avatar
0 votes
0 answers
221 views

Use values for scripts from multiple index in elasticsearch

Is there a way to write a script that can read values from multiple indexes and produce results in Elasticsearch? For eg: curl -XGET 'localhost:9200/index1,index2/_search?pretty' -d ' { "...
karthik95's user avatar
0 votes
1 answer
252 views

Loading groovy classes with conflicting names

I use GroovyScriptEngine inside my Java application to load code dynamically from different sources. Let's say I have two folders sources_A\ and sources_B\. GroovyScriptEngine engine = new ...
Eric Leibenguth's user avatar