how to upload file ,
I have option : when I click then mentioned screen will open, how to select image ?
There is the âuploadâ statement that you can try.
Example:
WebUI.uploadFile(findTestObject(âinput_browseâ), âD:\test-photo.pngâ)
Additionally, you might be able to use the Robot to assist you.
import java.awt.Robot
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.awt.event.KeyEvent
StringSelection ss = new StringSelection('pathway to file.txt');
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
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);
WebUI.waitForPageLoad(10)
Hi @noor.ahmed, This could help too: How-to use âsendKeysâ or 'File Upload' to upload files
