java – Not able to click the “Choose File” button in selenium webdriver. The upload window for file is not opening

I was supposed to click a ” Choose File ” button on a website and it is supposed to open a window that allows me to choose the file but the window does not open even if I code it to click the element.


WebDriver driver=new ChromeDriver();


WebElement uploadPhotoBtn = driver.findElement(By.xpath("//input[@id='file-upload']"));

after this upload, the window should open but it’s not.

Read more here: Source link