cancel
Showing results for 
Search instead for 
Did you mean: 

Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

SOLVED
Highlighted
New Contributor

Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

Automate the process to launch rdp connection(via mstsc) and connect to VM machine.

Issue was that mstsc launches Windows security pop up and testcomplete could not reach to password textbox.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
New Contributor

Re: Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

Resolution:

Capture Windows security popup as Edge browser object, and bring focus of Testcomplete to Windows security pop up

View solution in original post

Highlighted
New Contributor

Re: Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

Code extract:

    vProcess = Sys.Process("mstsc");

    mProcess = Sys.Browser("edge").Login;   // windows security window when user clicks connect button on mstsc

   

    //machine name

    exestatus = mvObjects.enterEditText(vProcess, "Window(\"Edit\", \"\", 1)", machine_to_connect,exestatus);

 

   

     //more options link

    exestatus = mvObjects.buttonClick(vProcess, "Name", "Window(\"ToolbarWindow32\", \"\", 1)",exestatus);

    Sys.Desktop.Keys("[Tab]");

      

    //username

    exestatus = mvObjects.Fullnametext(vProcess, "*Window(\"#32770\", \"General\", 1).Window(\"#32770\", \"Credentials\", 1).Window(\"Edit\", \"\", 1)",username,exestatus);

   

    //click connect button

      exestatus = mvObjects.buttonClick(vProcess, "Name", "Window(\"Button\", \"Co&nnect\", 3)",exestatus);

   

    exestatus = mvObjects.objectFocusClickMstsc(mProcess, "WndCaption","Windows Security",exestatus);

  

     Sys.Desktop.Keys(password);

 

Function:

function objectFocusClickMstsc(searchProcess, propertyName, findObject,exestatus) {

 

if (equal(exestatus,true)) {

 

      control = searchProcess.Find(propertyName, findObject, 1000);

      if (control.Exists) {

            control.SetFocus();

            control.click();

     Log.CheckPoint("Button is focused on '"+ findObject+"' and  clicked.");

  

      } else {

            Log.Error("objectFocusClick","The object was not found. objectHover function. object: " + findObject);

    exestatus = false;

      }

 

  }

 

else {

  Log.Message("objectFocusClick","The action is skipped since the execution status is set as '"+exestatus+"'");

 

  }

  return exestatus; 

 

 

} // objectFocusClick

View solution in original post

2 REPLIES 2
Highlighted
New Contributor

Re: Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

Resolution:

Capture Windows security popup as Edge browser object, and bring focus of Testcomplete to Windows security pop up

View solution in original post

Highlighted
New Contributor

Re: Why TestComplete cannot detect object to enter credentials on windows security popup of mstsc

Code extract:

    vProcess = Sys.Process("mstsc");

    mProcess = Sys.Browser("edge").Login;   // windows security window when user clicks connect button on mstsc

   

    //machine name

    exestatus = mvObjects.enterEditText(vProcess, "Window(\"Edit\", \"\", 1)", machine_to_connect,exestatus);

 

   

     //more options link

    exestatus = mvObjects.buttonClick(vProcess, "Name", "Window(\"ToolbarWindow32\", \"\", 1)",exestatus);

    Sys.Desktop.Keys("[Tab]");

      

    //username

    exestatus = mvObjects.Fullnametext(vProcess, "*Window(\"#32770\", \"General\", 1).Window(\"#32770\", \"Credentials\", 1).Window(\"Edit\", \"\", 1)",username,exestatus);

   

    //click connect button

      exestatus = mvObjects.buttonClick(vProcess, "Name", "Window(\"Button\", \"Co&nnect\", 3)",exestatus);

   

    exestatus = mvObjects.objectFocusClickMstsc(mProcess, "WndCaption","Windows Security",exestatus);

  

     Sys.Desktop.Keys(password);

 

Function:

function objectFocusClickMstsc(searchProcess, propertyName, findObject,exestatus) {

 

if (equal(exestatus,true)) {

 

      control = searchProcess.Find(propertyName, findObject, 1000);

      if (control.Exists) {

            control.SetFocus();

            control.click();

     Log.CheckPoint("Button is focused on '"+ findObject+"' and  clicked.");

  

      } else {

            Log.Error("objectFocusClick","The object was not found. objectHover function. object: " + findObject);

    exestatus = false;

      }

 

  }

 

else {

  Log.Message("objectFocusClick","The action is skipped since the execution status is set as '"+exestatus+"'");

 

  }

  return exestatus; 

 

 

} // objectFocusClick

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors