Contributions
Re: Want to mark test step as failed
thanks for the reply i am using the same gauravkhuranawrote: I have the same problem as mentioned by you YOu want the teststep to appear fail but still want the test to continue. You cannot use assert as it stops the step there. Testrunner.fail stops testcase execution So what you can do is in each step take an arraylist ArrayList err=[] add all errors to it.. err.add (" error occured ") in the last print this arraylist err.each{log.info it} so if there are any error they will be printed. for marking the teststep as red that is failed assert err.size()==0 Regards Gaurav Khurana www.udzial.com7 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.2KViews0likes0CommentsSecurity testing with NoSQL injections
HI all, I am trying to do NoSQL injections as part of my security testing because we are using MongoDB , Would you help me on this how to do NoSQL Injections, I tried below but seeing empty request and empty response in my custom Script 1. I add "Add Scan" and verified Parameters and noticed by default request as created as Parameter of type Request --> i ran my request and i am seeing valid requets and response Json request iam seeing as follows { "permissionName": "SecurityPName1", "scopeObjectId": "SecuritySOID1", "userId": "SecurityUID1" } And also i am saw valid response 2. But this time i removed Parameter request and added as same as in my attachment 1 But i see no request and no response (not sure why) What i really wan to do is inject NoSQL to my request to do this i thought i can use custom script and add My parameter values through the script (parameter names are actually taken from above jason script) -->not sure whther this is possible or not, i looked at SOAPUI help documents but i couldn't figure-out the solution so please give me step by step solution using above json Thanks Anusha7 years agoPlace ReadyAPI QuestionsReadyAPI Questions770Views0likes1CommentRe: Connecting to Mongo DB is Timed Out
I solved it by myself by using below code (i have already placed gmongo jar and also mongo java driver jar) I downloaded mongoDB drivers from here http://mvnrepository.com/artifact/org.mongodb/mongo-java-driver and here http://mvnrepository.com/artifact/com.gmongo/gmongo import com.gmongo.GMongo import com.mongodb.BasicDBObject import com.mongodb.DB import com.mongodb.DBCollection import com.mongodb.DBCursor import com.mongodb.* import com.mongodb.MongoException def javaMongo = new MongoClient(new MongoClientURI("mongodb://xxxxx:xxxxx/?ssl=true&replicaSet=globaldb")) def db = javaMongo.getDB('DBName') def table = db.getCollection("DBTbleName"); def query = new BasicDBObject("UserId", "XXXXX") def cursor = table.find(query) try { while(cursor.hasNext()) { log.info cursor.next() } } finally { cursor.close() }7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews1like0CommentsRe: Connecting to Mongo DB is Timed Out
I solved it by myself by using below code (i have already placed gmongo.jar and also mongo-java-driver.jar) import com.gmongo.GMongo import com.mongodb.BasicDBObject import com.mongodb.DB import com.mongodb.DBCollection import com.mongodb.DBCursor import com.mongodb.* import com.mongodb.MongoException def javaMongo = new MongoClient(new MongoClientURI("mongodb://xxxxx:xxxxx/?ssl=true&replicaSet=globaldb")) def db = javaMongo.getDB('DBName') def table = db.getCollection("DBTbleName"); def query = new BasicDBObject("UserId", "XXXXX") def cursor = table.find(query) try { while(cursor.hasNext()) { log.info cursor.next() } } finally { cursor.close() }7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes0CommentsRe: Connecting to Mongo DB is Timed Out
HI ALL, at my workplace we are using Mongo Document DB so would you please give me steps to connect to DB, This is really high priority for me please help on this I am using groovy script to connect to Mongo DB and i am using below lines of code and it is giving me error as follows import com.gmongo.GMongo def mongo = new GMongo('HOSt And PORT') def db = mongo.getDB('DB Name') log.info db.Permissions.findOne() Note: I Kept gmongo-1.5.jar and also mongo-java-driver-3.2.2.jar files inlocation Program Files - SmartBear - ReadyAPI-2.2.0 - bin - ext Error i am getting is as follows An error occurred Timed out while waiting to connect after 10000 ms, see error log for details Your reply will be appreciated Thanks Anusha7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes2CommentsConnecting to Mongo DB is Timed Out
HI ALL, at my workplace we are using Mongo Document DB so would you please give me steps to connect to DB, This is really high priority for me please help on this I am using groovy script to connect to Mongo DB and i am using below lines of code and it is giving me error as follows import com.gmongo.GMongo def mongo = new GMongo('HOSt And PORT') def db = mongo.getDB('DB Name') log.info db.Permissions.findOne() Note: I Kept gmongo-1.5.jar and also mongo-java-driver-3.2.2.jar files inlocation C:\Program Files\SmartBear\ReadyAPI-2.2.0\bin\ext Error i am getting is as follows An error occurred [Timed out while waiting to connect after 10000 ms], see error log for details Your reply will be appreciated Thanks AnushaSolved7 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes3CommentsRe: Connection to MongoDB
HI Srikanth, at my workplace we are using Mongo Document DB so would you please give me steps how you solved this issue, i am facing problems to connect with Mongo Document Db. I am using groovy script to connect to Mongo DB and i am using below lines of code and it is giving me error as follows import com.gmongo.GMongo def mongo = new GMongo('HOST:PORT') def db = mongo.getDB('DB Name') log.info db.Permissions.findOne() Error i am getting is as follows org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 1: unable to resolve class com.gmongo.GMongo @ line 1, column 1. import com.gmongo.GMongo ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class com.gmongo.GMongo @ line 1, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) Your reply will be appreciated Thanks Anusha856Views0likes0Comments- 1.5KViews0likes2Comments
REST Request Test Step is not running when i ran it from test case
HI all, Goal: my goal is to run my script million times to store my values in DB, it ran fine upto 760000 and stopped . since then its not running from test case or when i run it from script (from my 3rd test step) so i want to finish remaining 300000 records) Please help me onthis ,(more details as follows) Suddenly my test step stops running when i run it from test case, when i open Test step i am seeing (attachment 1 with no raw response) - Please see my attachment 2 where i am sending valid json response by getting data from Project properties I ran same request on test step itself and it ran fine and Output is also displaying as expected (see attachment 3) When You look at My test case you notice i created 3 test steps 1. POST request 2. Groovy script with below code and 3. Groovy test step with Below code 2. code as follows import com.eviware.soapui.support.XmlHolder def parsedJson = new groovy.json.JsonSlurper().parseText(context.response) log.info parsedJson // def arg = [parsedJson.permissionName,parsedJson.scopeObjectId,parsedJson.userId] def PnameTextAndValue = CallPermissions(parsedJson.permissionName) PnameTextAndValue = PnameTextAndValue.substring(PnameTextAndValue.indexOf("[") + 1, PnameTextAndValue.indexOf("]")) def Pnamefields = PnameTextAndValue.split(','); int PnameIntVlal = Pnamefields[1].toInteger() + 1 def PnameAlpha = Pnamefields[0] + PnameIntVlal.toString() log.info "PnameAlpha--->"+PnameAlpha testRunner.testCase.testSuite.project.setPropertyValue("permissionName", PnameAlpha) def SOIdTextAndValue = CallPermissions(parsedJson.scopeObjectId) SOIdTextAndValue = SOIdTextAndValue.substring(SOIdTextAndValue.indexOf("[") + 1, SOIdTextAndValue.indexOf("]")) def SOIdfields = SOIdTextAndValue.split(','); int SOIdIntVlal = SOIdfields[1].toInteger() + 1 def SOIdAlpha = SOIdfields[0] + SOIdIntVlal.toString() log.info "SOIdAlpha--->"+SOIdAlpha testRunner.testCase.testSuite.project.setPropertyValue("scopeObjectId", SOIdAlpha) def UIdTextAndValue = CallPermissions(parsedJson.userId) UIdTextAndValue = UIdTextAndValue.substring(UIdTextAndValue.indexOf("[") + 1, UIdTextAndValue.indexOf("]")) def UIdfields = UIdTextAndValue.split(','); int UIdIntVlal = UIdfields[1].toInteger() + 1 def UIdAlpha = UIdfields[0] + UIdIntVlal.toString() log.info "UIdAlpha--->"+UIdAlpha testRunner.testCase.testSuite.project.setPropertyValue("userId", UIdAlpha) String CallPermissions(def currentFieldValue ) { String[] parseArg = currentFieldValue.split("(?<=\\d)(?=\\D)|(?=\\d)(?<=\\D)"); def numb = Arrays.toString(parseArg[1]) String numbResult = numb.substring(numb.indexOf("[") + 1, numb.indexOf("]")); // int IntVlal = numbResult.toInteger() // log.info "IntVlal--->"+IntVlal log.info (Arrays.toString(parseArg[0])) String TextResult = (Arrays.toString(parseArg[0])) TextResult = TextResult.substring(TextResult.indexOf("[") + 1, TextResult.indexOf("]")); log.info "TextResult-->"+TextResult return [TextResult,numbResult] } 3. Code as follows import com.eviware.soapui.support.XmlHolder for(int i=1; i<=300000; i++) { def testStep = testRunner.testCase.testSteps['POST'] testStep.run( testRunner, context ) def testStep1 = testRunner.testCase.testSteps['IncrementPermission'] testStep1.run( testRunner, context ) }Solved1.5KViews0likes3Comments