When I try to upload a.jpg file to my application in the saucelabs virtual test, I get an error.
Using driver.SendKey() to upload the file to the application in the saucelab VM machine. I'm trying to figure out the correct path to get the jpg file from sauce-storage using SendKeys. Please help
code:
{
IAllowsFileDetection allowsDetection = driver as IAllowsFileDetection;
if (allowsDetection != null)
{
allowsDetection.FileDetector = new LocalFileDetector();
}
driver.SendKeys(element, "sauce-storage:oldtraford.jpg");
}
Error:
Test failed with error: OpenQA.Selenium.WebDriverException: unknown error: path is not absolute: sauce-storage:oldtraford.jpg (Session info: chrome=74.0.3729.185) (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-54-generic x86_64) at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Appium.AppiumDriver
1.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary
2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text) at BST10Web.Framework.UI.Helpers.UiElementHelpers.EnterText(IWebElement element, String value