The interface called by executeScript is not working properly

async function addJobGroup() {
let myHeaders = new Headers();

myHeaders.append(“Accept”, “application/json, text/plain, /”);
myHeaders.append(“Authorization”, ${token});
myHeaders.append(“Referer”, “http://172.16.1.162:9999/robot/RobotJobGroupList”);
myHeaders.append(“X-Access-Token”, ${token});
myHeaders.append(“Content-Type”, “application/json;charset=UTF-8”);

let callJsonObject= ${callJsonObject};

let formData = new FormData();
const jsonData = JSON.stringify(callJsonObject);
formData.append(‘data’, jsonData);
formData.append(‘draft’, 0);

var requestOptions = {
method: ‘POST’,
headers: myHeaders,
body: formData,
redirect: ‘follow’
};
const res = await fetch(“http://172.16.1.162:9999/yxzl/robot/job/batchAddJobs?jobGroupId=5aea8b83-e95a-48b2-8de2-3441ef444e59”, requestOptions).then(response => response.json())
return res.result
}
return addJobGroup();

I am accessing the backend API through JavaScript, but when monitoring through F12, I only sent one request to the backend. However, the backend interface received two requests at the millisecond level. When using the same request method with Postman, the backend only receives one request. I’m currently unsure of how to resolve this issue.

Hi, just to clarify:

  • Are you using Ui.Vision V9.05 or higher?

  • So you are saying the executeScript command gets called twice?

We had this issue in the past, but it should be fixed.