Contributions
Re: Dynamically change the header
Use "get Data". (right click) https://support.smartbear.com/readyapi/docs/testing/properties/get-data.html?sbsearch=Get%20Data Get use to this functionality, as this is the very core and best functionality that Readyapi has!2 years agoPlace ReadyAPI QuestionsReadyAPI Questions367Views1like1CommentI would like to get results back from a powershell script with a Groovy teststep in readyApi
In readyapi groovy test step: def runPowerShell = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"C:\\temp\\test.ps1".execute() runPowerShell.waitFor() In the powershell script test.ps1: $SASToken = "test" return$SASToken echo$SASToken Test step Result in Readyapi: result = 1 I would like to get the value "test"337Views0likes0CommentsRe: How to manipulate Values in combination with "get data" or "Message Content Assertion"
Ok, enough time has been spent on this topic. I have solved it with Groovy using Substring and lowerCase functions. This was not my prefered solution, but it works. richie: if you need help with Groovy and Substring, you can have a look at this website:http://grails.asia/groovy-substring Or show me an example with the issue and the desired result. I might be able to help you. Donny6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes1CommentRe: How to manipulate Values in combination with "get data" or "Message Content Assertion"
Hi, Currently i am on track with this: String estimatedArrivalDate = "2017-08-02 21:00:00.000" String locationDescription = "Port" String involvedPartyName = "JFHillebrand" log.info estimatedArrivalDate.substring(0,10)+ "T" + estimatedArrivalDate.substring(11,19) log.info locationDescription.toLowerCase() log.info involvedPartyName[0,1].toLowerCase() + involvedPartyName.substring(2) Result: Fri May 18 16:02:01 CEST 2018:INFO: 2017-08-02T21:00:00 Fri May 18 16:02:01 CEST 2018:INFO: port Fri May 18 16:02:01 CEST 2018:INFO: jfHillebrand So it works, but it isn't that pretty... Does this help your issue? so if i want to save my results in the testcase "Custom Property" than i add the following line: estimatedArrivalDate = estimatedArrivalDate.substring(0,10)+ "T" + estimatedArrivalDate.substring(11,19) testRunner.testCase.setPropertyValue("estimatedArrivalDate", estimatedArrivalDate )6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes0CommentsRe: How to manipulate Values in combination with "get data" or "Message Content Assertion"
Hi Richie, I am aware of the UPPER and LOWER functions in SQL, but due to reasons i cannot do that here. (long boring story). I like your sugestion to use a wildcard with message assertion. I will try that out :) And so far i have been looking into groovy script: Date: def requestedArrivalDate = context.expand( '${LDS SP TimeLine#requestedArrivalDate}.substring(0,19)' ) Date date = Date.parse("yyyy-MM-dd HH:mm:ss",requestedArrivalDate) testRunner.testCase.setPropertyValue(requestedArrivalDate, date.format("yyyy-MM-dd'T'HH:mm:ss")) LowerCase: def locationDescription = context.expand( '${LDS SP TimeLine#locationDescription}' ) testRunner.testCase.setPropertyValue("Location", locationDescription.toString().toLowerCase()) But i was hoping for an far easier solution. For example that we can do "get data" and as a result do something like: '${LDS SP TimeLine#locationDescription}'.toString.toLower6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes2CommentsHow to manipulate Values in combination with "get data" or "Message Content Assertion"
Hi, I am using a stored procedure to get results and compare them to the API. So example SQL stored procedure results: Id, Type, Date 1, Address,2018-08-18 00:00:00.000 2, Port,2018-02-20 10:02:00.000 Response from the API: "id" : "1", "locationType" : "address", "date" : "2018-08-18T00:00:00" and "id" : "2", "locationType" : "port", "date" : "2018-02-20T10:02:00" So when i do a "Message Content Assertion", it will fail on the lowercase location type and it will fail on the date format. Does anybody have an idea what the best way is to solve this? Lets assume that i need to use the stored procedure, because of valid reasons. See attachments of my real test case. Regards, Donny6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes6CommentsGroovy Script using bat file
Hi, I am using a bat file in a Groovy step and I get the folllowing results (see attachment). --> INFO: MXM-AUS-1720-0018 How can i put this string ( MXM-AUS-1720-0018)into a property so i can use it in my API testing. Or maybe I can use it with "Get data" Groovy script result? Regards, DonnySolved7 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.5KViews0likes2Comments