Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

java - How could i perform RestAssured API parallel Execution using cucumber gradle

I am new to gradle, as i am facing an challenge to run RestAssured Api calls in parallel. Below is the sample code of HttpRequest and HttpResponse objects where i need to perform parallel execution on them .

import io.restassured.RestAssured;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
import org.json.JSONArray;
import org.json.JSONObject;

    public class BaseStepClass  {
        public static  RequestSpecification httpRequest=null;
        public static Response response=null;
        
        
        
        public RequestSpecification get_httpRequest_Ref(String url)
        {
            
            
            System.out.println("1.Called the RequestSpecification method");
            
            
            if(httpRequest==null)
            {           
                System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");                      
                RestAssured.baseURI = url;
                httpRequest = RestAssured.given().log().all();
                
            }
            else
            {
                System.out.println(" HttpRequest is not null");
            }
            
            return httpRequest;
        }
    
        
        
        public static Response getHttpResponse(String endpoint_path)
        {   
            response = httpRequest.get(endpoint_path);
            return response;
        }
    
     }

Any advise or help on above issue will be greatly appreciated. Also let me know if you need more info.

question from:https://stackoverflow.com/questions/65944678/how-could-i-perform-restassured-api-parallel-execution-using-cucumber-gradle

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...