You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
I have generated a script file by using openAPIgenerator but while running it through K6, its skipping some APIs. It is not giving any error. Can you suggest me a way to find out why it is skipping that and how can I debug it?
Example API:
importhttpfrom"k6/http";import{group,check,sleep}from"k6";constBASE_URL="http://host:port";// Sleep duration between successive requests.// You might want to edit the value of this variable or remove calls to the sleep function on the script.constSLEEP_DURATION=0.1;letbody="";letfile={"file": http.file(open("D:/test/file.yaml","b"),"file.yaml")};letauthorization="";exportdefaultfunction(){group("/api/v1/upload-file",()=>{letuserId=2;leturl=BASE_URL+`/api/v1/upload-file`;// Request No. 1// TODO: edit the parameters of the request body.letparams={headers: {"Content-Type": "multipart/form-data","Authorization": `${authorization}`,"Accept": "*/*"}};letrequest=http.post(url,file,params);check(request,{"OK": (r)=>r.status===200});sleep(SLEEP_DURATION);});}
The text was updated successfully, but these errors were encountered:
This question seems better suited for the community forum. In any case, you can debug your scripts with console.log() and dumping parts of the HTTP Response object, or maybe by running k6 with --http-debug.
Edit: the script you posted seems fine to me, at a quick glance...
I have generated a script file by using openAPIgenerator but while running it through K6, its skipping some APIs. It is not giving any error. Can you suggest me a way to find out why it is skipping that and how can I debug it?
Example API:
The text was updated successfully, but these errors were encountered: