I am using k6 run to run a test previously built by another person in other computer but seems like open function is not loading the content of json confi file in this javascript test file from k6.
I have readed pages about this but nothing is very clear, what i am doing is this:
i have a file called file1.json
i have other test file (a javascript test file which is calling the file1.json using k6 open function), and this line there: const fileContent = JSON.parse(open(“…/Settings/file1.json”));
The path is right because i can open other files but using import or other javascript methods with the same path.
when i try to use the file content in this javascript test file i see the file content as unknown.
Is this a bug from open method or something else ?
when i was calling the inside the default function the file wasn’t read and the catch prints the error and “Finish” wasn’t printed on the console, but when i moved the function outside of the default function the error was gone and the bytes length was printed along side with “Finish”
Note: the contents “console.log(imageByte);” will be always empty, i think the CMD doesn’t print the byte array, i was sure that its correct by printing “console.log(imageByte.byteLength);”, it gave me a length which i made sure its correct by writing a C# code that converts an image to a byte array, and the length was the same for the same image