javascripttestcompletealiasestemplate-aliases

Click not working using variable in testcomplete


Click not working using variable in testcomplete as following.

var okbtn= "Aliases.LateralData_Applications_Dashboard.LoginForm.btnOK";
  okbtn.ClickButton();

while direct click without variable is working fine as following.

 Aliases.LateralData_Applications_Dashboard.LoginForm.btnOK.ClickButton();

I am using testcomplete 10 and java script


Solution

  • in your 1st example okbtn is a string,you should do

    var okbtn= Aliases.LateralData_Applications_Dashboard.LoginForm.btnOK