Forum Discussion

Mk1's avatar
Mk1
Occasional Contributor
7 years ago
Solved

Hi SmartBear Team,How do i convert a string from property file to an Object? eval is not helping.

'undefined' is null or not an object this is the value i'm reading from my property file    genericAuthButton=Sys.Browser("iexplore").Page(Project.Variables.pPage).Object("app").PowerCardV3_1("app...
  • shankar_r's avatar
    shankar_r
    7 years ago

    You can still test your scenario with the below code

     

    function test()
    {
    doStuff(context.get("genericAuthButton"));
    }

    function doStuff(genButPath)//Pass your hasp map string value { var localBtnPath = eval(genButPath);//here your genButPath shouold be your Object FullName if(localBtnPath.Exists) { localBtnPath.TextInput("period_codeTI").Keys(context.get("PeriodCode")); } else { Log.Error("Object not exists for the Fullname" + genButPath); } }