Forum Discussion

Maitrayee's avatar
Maitrayee
Frequent Visitor
4 years ago

ERROR:groovy.lang.MissingPropertyException: No such property: org for class: Script10.

I am getting an error at this line:

def response = org.apache.http.impl.client.HttpClients.createDefault().execute( get )

 

// Create and send a request
def get = new org.apache.http.client.methods.HttpGet( "https://tst.kaptcha.com/collect/sdk?m=100180" )
def response = org.apache.http.impl.client.HttpClients.createDefault().execute( get )

// Obtain the body of the response
def content = response.entity.content.text

//log.info content

//Get the index for locating the fraud session key
def sessionIdIndex= content.indexOf("ka.sessionId=")
def merchantIdIndex= content.indexOf(";ka.merchantId")

//Store the fraud key
def fraudSessionKey = content.substring(sessionIdIndex+14,merchantIdIndex-1)
log.info fraudSessionKey

//Set value to testSuite level
project = testRunner.testCase.testSuite.project
testSuite = testRunner.testCase.testSuite
testCase = testRunner.testCase

testRunner.testCase.testSuite.setPropertyValue( "fraudToken", fraudSessionKey )

1 Reply

  • nmrao's avatar
    nmrao
    Champion Level 3
    What are you trying to do?

    What happens if you do import the class, HttpClients?
    What version of the are you using?