Click not working using variable in testcomplete

98 Views Asked by At

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

1

There are 1 best solutions below

0
Lorenzo Catalano On BEST ANSWER

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

var okbtn= Aliases.LateralData_Applications_Dashboard.LoginForm.btnOK