Forum Discussion

awjones's avatar
awjones
Occasional Contributor
5 years ago

How to read the ContentText value from an object property

Hello,

 

I used the Object Spy tool capture and bring in an object in my code. After mapping it, the full mapped name is: 

"Aliases.browser.KtxLoginForm.tableTable2.cell4".

 

I then assigned it to an object variable to be used further down in the code:

var ReadObjData = Aliases.browser.KtxLoginForm.tableTable2.cell4;

 

In the Object Spy Properties or "Debug Watch" on the object variable, the ContentText for the object is KT0000000799.

 

Is there a build in method that can read the ContentText value or even the innerText value from the object? If so please provide an example. Or just an example of how to retrieve the ContentText/innerText values. 

 

Code: JScript 

 

Really appreciate it.

Thanks in advance.

-Al

  • Hello,

     

    Thanks for your reply. Will try that. Should have known that the mapped object properties can be accessed with the dot notation. I'm using JScript so OOP would apply here.

     

    Regards.

  • BenoitB's avatar
    BenoitB
    Community Hero

    To read the contextText just read the value of yourObject.contentText property

     

    if (Sys.Browser("*").Page("*").Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).Panel(0).TextNode(0).contentText != "")
    Sys.Browser("*").Page("*").Panel(0).Panel(0).Panel(0).Panel(0).Panel(1).Button("btnYes").Click();
     

     

    Perhaps i don't understand your problem ?

    • awjones's avatar
      awjones
      Occasional Contributor

      Hello,

       

      Thanks for your reply. Will try that. Should have known that the mapped object properties can be accessed with the dot notation. I'm using JScript so OOP would apply here.

       

      Regards.