Contributions
ServiceV routing
Hello Community! I have a similar case as this one:https://community.smartbear.com/t5/ReadyAPI-Feature-Requests/ServiceV-selective-routing/idi-p/106004 Initially I was asked to route the request to a virtual/real service depending on a query string value. I was able to get that done with no problem. Routing option and dispatcher made it to work as expected but now that it's set up like that I have another request. Dev Team wants me to send the request over real service and if response return a code such as 404, 500, 504 then re-route to virtual service instead. I just want to confirm if there will be a tool limitation or if is something feasible to create. To be honest I'm not even sure if Smartbear would be able to capture the reponse from the real service to eventually place the values into a dispatcher scripts. I don't want to say NO! without giving a try. Feel free to give your opinion!1.4KViews0likes1CommentRe: Datasources - External Database MySQL as Datasource
Hello Tanya! I made a mistake by not checking the JDBC connector driver first. I was told the install was ready for MySQL but when I checked for MySQL connector it was missing.I copied the driver and everything worked as expected. Thank you very much for your reply. Lesson learned! Regards, Tona O.7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.6KViews0likes0CommentsDatasources - External Database MySQL as Datasource
Hello! I have Ready!API installed in a server which I want it to connect to an external MySQL database that I would use as datasource. So when I try to make a connection it fails even if the connection string is fine. I'm attaching a screenshot of the error but also I would like to confirm is datasource can beused only from local computer (where Ready!API is installed). I tested a connection with SQLdeveloper from this server and it works. I looked on documentation and I found the following: Databases Using a database as the data source requires that the appropriate database provider be installed on the LoadComplete computer. To learn more about database providers and the syntax of database connection strings, visit http://connectionstrings.com. Please help me to confirm if this is why my connection is failing. I'll appreciate your help. -Tona Ortega.Solved7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.7KViews0likes4CommentsHow to get the time taken from a VIRT Response
Hi Community! I've been working building services for Performance Test purposes and I got asked if I could track down the response time that takes the Virt to reply back to an incoming request. I've found an instruction that gets me MockResponse Time Taken. I'm not sure if this would be accurate, if I trigger a requestfrom SoapUI, the actual response time is different as on timeTaken result. Here's the instruction: log.info "Time Taken:" +mockResponse.getMockResult().timeTaken Result: 2017-05-10 18:07:10,862 INFO [log] Time Taken:35 SoapUI log: response time:89ms (7003 bytes) My guess is SoapUI log is taking response time from messages exchange (request&response), if this is the case what wouldtimeTaken is measuring? I placed the instruction on Response Script. I'll appreciate your thoughts. -Tona Ortega.7 years agoPlace ReadyAPI QuestionsReadyAPI Questions3KViews0likes3CommentsRe: Can I load excel datasource properties into ServiceV Dispatcher script?
The solution was to create a mysql DB instance in my server and copy all the info from the spreadsheet into it. As I need to validate & compare incoming request data in my dispatcher script I used the following script: This is a REST service: 1. Create Custom Properties with dbName, dbUsername, dbPassword, dbHost and add the values needed. 2. Use this code into dispatcher script: //Get data from Request def jsonSlurper = new JsonSlurper() def requestObj = jsonSlurper.parseText(mockRequest.getRequestContent()) assert requestObj instanceof Map // open connection def Virtservice = context.getMockService() def conString = "jdbc:mysql://" + Virtservice.getPropertyValue( "dbHost" ) + "/" + Virtservice.getPropertyValue( "dbName" ) log.info conString //Define SQL Connection as follow: def sql = Sql.newInstance(conString, Virtservice.getPropertyValue( "dbUsername" ), Virtservice.getPropertyValue( "dbPassword" ), 'com.mysql.jdbc.Driver') // Execute Query: Where userId is defined from incoming request data def query = "SELECT sessionToken FROM users WHERE userID LIKE '" + requestObj.userId + "';" //row value will get the entire row as result from query above. def row = sql.firstRow(query) //Set property value email with value found in row.email. context.setProperty("email",row.email) //check for connection in context sql.close() I hope this helps! Let me know if you have any question. Tona O.8 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.6KViews0likes0CommentsRe: Can I load excel datasource properties into ServiceV Dispatcher script?
Hi Tanya, I've seen this documentation before. Nothing from there could help to make it work. I implemented another solution. What I did is I had to build a local DB and populated with spreadsheet info. Then I pulled info from Dispatcher script using groovy SQL functions. It turns to be more work but finally an easier solution that read spreadsheet. I appreciate your reply. I'll post the code later for future reference to other people that could face same problem. Regards, Tona O.8 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.6KViews1like1CommentRe: how to get datasource property value and assign it to a variable from Virt editor
Hello, Did you solve your problem? I'm trying to get values from excel datasource but I'm unable to get it using my script dispatcher. I don't know how to get them, it sounds like is similar to your question.8 years agoPlace ReadyAPI QuestionsReadyAPI Questions3KViews0likes2CommentsCan I load excel datasource properties into ServiceV Dispatcher script?
Hello, I'm trying to virtualize a service for Login call. It's basically two responses: LoginSuccess and LoginFail. So I'm trying to write a SCRIPT to dispatch the response. Its a REST Request and I'm using JSON. I've added a datasource excel file there and I would like to read the values from, and save them into variables in my dispatcher script. I've been struggling a lot trying to get the proper instruction to do it. My datasource contains user, email, password and a token. What I want to do is, get the user, email, password from datasource and compare the same from the incoming request, compare both and if valid then return LoginSuccess and a token within. Is there any way I can do this? I'm very new to Ready!API so I'm not sure if is feasible. Any other suggestion may be? Thanks!Solved8 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.8KViews1like4Comments