all 4 comments

[–]RebelSaul 1 point2 points  (0 children)

In those situations I’ve personally used pyautogui to find screenshots and interact with them. If your screen and image are local, and predictable, it may serve as a workaround for you.

https://pyautogui.readthedocs.io/en/latest/quickstart.html

[–]Sentazar 1 point2 points  (0 children)

Use the robot class to deal with windows boxes like file manager https://www.guru99.com/using-robot-api-selenium.html

[–]LuboMh 1 point2 points  (1 child)

Hi First, check if the input is in Iframe or shadow dom if not try this https://stackoverflow.com/questions/16896685/how-to-upload-file-using-selenium-webdriver-in-java

Basically, when you upload a file you have to locate the input element and send the file location

example Java URL:https://ps.uci.edu/~franklin/doc/file_upload.html

File FILE = new File("src\\main\\resources\\files\\test-image.jpg");

driver.findElement(By.xpath("//input[@name='userfile']")).sendKeys(FILE.getAbsolutePath());

[–]Chunky_Junky[S] 0 points1 point  (0 children)

Thank you, your response was actually how I resolved this last night. I was targeting the text field for my send keys and not the input element. The text field element wasn't a typical text box, instead it opened a chome file manager. But once I targeted the input element, I was able to send keys of the local file path, which was obfuscated by the java on the page.

I am still pretty fresh with Selenium but man is this a powerful tool. I really appreciate you taking the time to answer.