I am trying to use Selenium with JavaScript, but I am having trouble uploading files from my local machine. I attempted to use 'upload.sendKeys(file path)', but it doesn't seem to be working. When I click on the upload button and a window opens to choose a file from my local machine, I am unsure how to proceed in selecting the file.
await findByCss(driver, selectContent).click();
await delay();
var upload = findByCss(driver, selectContent);
upload.sendKeys("C:/work/Pineapple-lab/for docola/Current_356226259_107392298_1024x576.jpg");
await delay();