I'm a beginner with WebDriver JS and typescript.
I'm trying to upload a file using WebDriver but I'm having trouble getting it to work. I attempted the code below, but unfortunately, it's not working (I'm using a Mac). Could you please advise on how I can successfully upload the file?
await driver.executeScript("arguments[0].scrollIntoView()", driver.findElement(By.xpath(locator)));
await driver.findElement(By.xpath(locator)).sendKeys(filePath);