I tried multiple ways to upload the image through the Windows File Explorer using WinAppDriver and Appium in C#, but I still couldn’t get it to work. I tested different approaches to interact with the file dialog and send the file path, but the image is not getting uploaded. At this point, I couldn’t find a reliable solution and may need guidance or an alternative method.
my code
public void UploadImage(string imagePath)
{
driver.SwitchTo().Window(driver.WindowHandles.Last());
var fileNameBox = driver.FindElementByAccessibilityId("1148");
fileNameBox.Clear();
fileNameBox.SendKeys(imagePath);
fileNameBox.SendKeys(OpenQA.Selenium.Keys.Enter);
}