AndyH79
14 years agoNew Contributor
Need to store an Object's parameter's value as a .NET 4 data type
I have a Visual Studio 2010 C# project which is running code to automate access to websites using IE. I need to know how to expose the property value located within the TestComplete object browser and store that value as a .NET datatype which I can export to SQL Server. I'm able to obtain the object reference using:
var totalMetersCell = page["TrendMeterUsage"]["formMeterresults"]["tableMainguitable"]["cell"]["table"]["cell"]["panelControlspanel"]["table"]["cell"]["table"]["cell"]["table"]["cellNncTdnncbody"];
var totalMetersForm = totalMetersCell["panelTabbody"]["panelNncDivlist"]["frameNncFrmlist"]["frameNncListMain"]["formNnclist"];
I can successfully do this:
var count = totalMetersForm["innerText"] ;
but it doesn't expose any values I can use in the locals window.
I've also tried this:
string count = (totalMetersForm["innerText"]).ToString();
which doesn't trip an error but stores "AutomatedQA.script.var+VarDelegate" as the value of count.
I'm also curious why this doesn't work:
var props = Connect.aqObject["GetProperties"](totalMetersForm);
It seems like a lot of the different functions with example code in the documentation don't work when you implement them as C# code in the Visual Studio project. Something I'm doing wrong? Or just lack of support for Connected Applications?
var totalMetersCell = page["TrendMeterUsage"]["formMeterresults"]["tableMainguitable"]["cell"]["table"]["cell"]["panelControlspanel"]["table"]["cell"]["table"]["cell"]["table"]["cellNncTdnncbody"];
var totalMetersForm = totalMetersCell["panelTabbody"]["panelNncDivlist"]["frameNncFrmlist"]["frameNncListMain"]["formNnclist"];
I can successfully do this:
var count = totalMetersForm["innerText"] ;
but it doesn't expose any values I can use in the locals window.
I've also tried this:
string count = (totalMetersForm["innerText"]).ToString();
which doesn't trip an error but stores "AutomatedQA.script.var+VarDelegate" as the value of count.
I'm also curious why this doesn't work:
var props = Connect.aqObject["GetProperties"](totalMetersForm);
It seems like a lot of the different functions with example code in the documentation don't work when you implement them as C# code in the Visual Studio project. Something I'm doing wrong? Or just lack of support for Connected Applications?