ashok_natar
11 years agoOccasional Contributor
Convert String to Objects
Hi All,
We are working on the application, where the Objects are unstable hence decided to get the Objects from xml and use it.
The issue is here! i am able to retrieved the node values successfully and when i print it, it printing the absolute the same string!!!
Issues is the testcomplete could do the action correctly! and also it throwing an error message?
is there any methord to convert the str to Object?
Really appreciated for any suggestion
sample code here !!
function Test_Test()
{
try
{
filepath_Setup="T:\\NameMapping\\OBJ.xml";
var Obj_Customer=aqConvert["VarToStr"](Utility["doGetxmlvaluebyNode"](filepath_Setup,"Data_Article_Number")) ;
//var Obj_Customer1=aqConvert["VarToStr"](Utility["doGetxmlvaluebyNode"](filepath_Setup,"Data_Article")) ;
//
Log["Message"]("Before action")
Obj_Customer["WinFormsObject"]("Customer")["SetText"]("Symphony Telca")
Log["Message"]("After action")
}
We are working on the application, where the Objects are unstable hence decided to get the Objects from xml and use it.
The issue is here! i am able to retrieved the node values successfully and when i print it, it printing the absolute the same string!!!
Issues is the testcomplete could do the action correctly! and also it throwing an error message?
is there any methord to convert the str to Object?
Really appreciated for any suggestion
sample code here !!
function Test_Test()
{
try
{
filepath_Setup="T:\\NameMapping\\OBJ.xml";
var Obj_Customer=aqConvert["VarToStr"](Utility["doGetxmlvaluebyNode"](filepath_Setup,"Data_Article_Number")) ;
//var Obj_Customer1=aqConvert["VarToStr"](Utility["doGetxmlvaluebyNode"](filepath_Setup,"Data_Article")) ;
//
Log["Message"]("Before action")
Obj_Customer["WinFormsObject"]("Customer")["SetText"]("Symphony Telca")
Log["Message"]("After action")
}
- Ashok,
It's not clear from the snipped what Obj_Customer contains after the following statement:
var Obj_Customer=aqConvert["VarToStr"](Utility["doGetxmlvaluebyNode"](filepath_Setup,"Data_Article_Number"))
If it includes a TestComplete full name, try Obj_Customer = eval(Obj_Customer);