I have write a script to attach a picture in selenium code. I run the selenium code on server, windows 2003 server 64 bit, if i open the remote desktop, the script will work, if i minimize the remote desktop, wait a moment , then reopen it, the script will execute to attach file, but it didn't click the "open" button, I don't know why i must open the remote desktop to let the script work.
Here are the codes:
$title = "打开"
$fileDir = "E:\aa.png"
WinWait($title)
WinActivate($title)
ControlSetText($title, "", "[CLASS:Edit; INSTANCE:1]", $fileDir)
Send("{Enter}")