My Code is as below, I'm executing the script using the Mac and running 2 nodes, 1 on windows and 1 on the mac itself. The upload on the Mac works perfect but the windows upload doesnt work.
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection str = new StringSelection("C:\\Sheyan.pdf");
clipboard.setContents(str, str);
if (systemType=="http://192.168.1.100:5555/wd/hub") **(THIS IS THE WINDOWSOS NODE)**
{
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
}
else **(FOR MAC OS NODE)**
{
selenium.click(driver, UploadButton);
WebElement fileInput = driver.findElement(UploadButton);
fileInput.sendKeys("/Users/accesstesting/Documents/Sheyan.pdf");
}