Contributions
Re: Using .dll files in Readyapi
Hi, Thank you all for you input. I have got a description on how this can be achieved but I have not been able to test it due to security restrictions I have at work. I am not abe to download the JNI4NET package as described by the smartbear support. Smartbear support message: You cannot call methods from a .NET assembly directly from Java programs and, consequently, from Groovy scripts, but there are special bridges that wrap the assembly in a special way, so such a call becomes possible.A popular free solution is jni4net. Also, there are a number of paid solutions that may be easier to use. Here is the workflow: 1. Assume that you have the SumTestAssembly.dll assembly which exposes the GetSum method. 2. You need to generate a proxy for your .dll file with the proxygen.exe tool. 3. Then, run thebuild.cmd file (you may have to modify it in order for Java and .NET compilers to be found). 4. Copyall the dependencies to the project folder. 5.Add jni4net.j-0.8.8.0.jar and SumTestAssembly.j4n.jar to the project, load the SumTestAssembly.j4n.dll proxy assembly to the bridge, and call the GetSum method. 6. After this, copy the dependencies to the <ReadyAPI>\bin\ext folder and try calling the GetSum method from the Groovy script test step. I hope this helps. Please note that SmartBear doesn't provide support for jni4net or any other similar library. So, if you have any difficulties with their usage, please refer to the docs and samples provided by the libraries' vendors. So if someone who does have Readyapi and is able to download the JNI4NET package can test this it would be nice to hear if it works.3 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews1like3CommentsUsing .dll files in Readyapi
Hi, In our c# development environment we use some .dll files (bought from external company) to convert files in different formats to .pdf. Is there a way to use these .dll files in some way also via Readyapi? I.e. I would like to point out a, let say, .jpeg file and then call the method found in the .dll files to convert it to .pdf? Is this possible at all?Solved1.8KViews0likes7CommentsSave script executed twice (old issue reported back in 2011?)
Hi, I have a script in the SAVE script but it always runs twice which causes issues for me. Exactly the same issue is described long time ago and according to reply it should have been fixed in version 4.0 for what I believe is the SoapUI version back in 2011 when the ticket was written. I am using ReadyAPI version 3.10.1! https://community.smartbear.com/t5/ReadyAPI-Questions/Save-script-is-executed-twice-on-save/td-p/19490 Smartbear, any comments on this?618Views0likes2CommentsRe: Save script executed twice (old issue reported back in 2011?)
Hi, I understand your confusion:-). Now when you point that out I see how strange it sounds. However, the "old" issue was mentioned back in 2011 so it must have been SoapUI version they referred to while I am using Readyapi ten years later which happen to have the version just below the one mention in the ticket 2011. I will check if I can rewrite the headline to "old SoapUI issue" instead of "old ReadyAPI issue". Thanks for that.3 years agoPlace ReadyAPI QuestionsReadyAPI Questions565Views0likes0CommentsRe: Replace one part in a request with the value from an variable
Chris, You are a true hero.. Thank you so much. It worked perfectly. Now I am able to read a .json file and set my project properties to the values from the secrets file. Without this I would have to declare every property manually which is not efficient at all. Great!! //get secret file for the active environment secretsJsonFile = projectpath + "ReadyApi_Secrets\\secrets_" + activeEnv + ".json" //get secrets file for the active environment log.info("secretsJsonFile = " + secretsJsonFile) // Read jsonfile and return text content def secretsFile = new File(secretsJsonFile); def parsedJson = new JsonSlurper().parseText(secretsFile.text) def oneItem, oneItemValue for(i = 0; i < numberOfProjectProperties; i++) { oneItem = projectPropertiesList[i] //get one item in the projectPropertiesList oneItemValue = parsedJson.secrets."$oneItem".toString() //get the value of the item from the secrets file log.info("oneItem = " + oneItem) log.info("oneItemValue = " + oneItemValue) //set global property value with value from secrets file testRunner.testCase.testSuite.project.setPropertyValue( projectPropertiesList[i], oneItemValue)3 years agoPlace ReadyAPI QuestionsReadyAPI Questions1KViews0likes1CommentReplace one part in a request with the value from an variable
Hi, Is there a way to replace the "XXXX" in the method below with the value of the variable replaceToken? def replaceToken = "username" parsedJson.secrets.XXXX.toString() I.e., I would like to achieve following automatically parsedJson.secrets.username.toString() Seems like an easy thing when working with strings but when I want to have it in a call then it always interprets the replaceToken as "replaceToken" and not "username"Solved1.1KViews0likes3CommentsRe: How to access CONTEXT object in SAVE/LOAD script in Project Settings
Hi, yea, that helped. Thank you so much. I will leave the ticket open, hopefully I will get some info about possibilities to get hold on context object. regarding the missed .getName(), it is strange because when I wrote "project." I get a list of different properties and methods to use, like getActiveEnvironment() and I tried to write "." after that as well but did not get any suggestions in Readyapi so I thought there was nothing. Where did you find this info if I may ask?3 years agoPlace ReadyAPI QuestionsReadyAPI Questions1KViews1like1CommentHow to access CONTEXT object in SAVE/LOAD script in Project Settings
Hi, I use below two lines of code to check the active environment. Works perfectly in a groovy test step. However if I put the same two lines in Project Settings->Save Script it does not work. Complains about null pointer. Any suggestions on how to solve or why this is? The message "Objects available by default: log, project" is presented but how do I access CONTEXT object? def env = context.testCase.testSuite.project.getActiveEnvironment().getName() log.info("Active Environment: " + env) I have also tried with "log.info("env = " + project.getActiveEnvironment())" but that one returns "INFO: env = com.eviware.soapui.model.environment.EnvironmentImpl@1becd" "Solved1KViews0likes5Comments