Forum Discussion

jrm0384's avatar
jrm0384
New Contributor
8 years ago
Solved

Cannot obtain the window with the window class '#32770' TWICE

Hello, currently I'm testing a web app developed in Silverlight 5 with Testcomplete 10 running on IE 10. I'm using a function to upload files and I get the next error:  "Cannot obtain the window w...
  • Ryan_Moran's avatar
    8 years ago

    Try this:

    function uploadFileHndl2(prStrFilePath){
      popup = Aliases["browser"]["Window"]("#32770", "Open", 2);
      txtFileName = Aliases["browser"]["Window"]("#32770", "Open")["Window"]("ComboBoxEx32", "", 1)["Window"]("ComboBox", "", 1)["Window"]("Edit", "", 1);    
      txtFileName["wText"] = prStrFilePath;
      btnOpenFile = Aliases["browser"]["Window"]("#32770", "Open")["Window"]("Button", "&Open", 1);
      Log["Event"]("Select the file to attach");
     
      if(btnOpenFile["Exists"]){
        btnOpenFile["Click"]();
        Delay(500);
      }
      else{
        Log["Message"]("Red Code!!!!");
      }
    }