cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the ContentText value from an object property

SOLVED
Highlighted
Occasional Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: How to read the ContentText value from an object property

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Leader

Re: How to read the ContentText value from an object property

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 ?

Un sourire et ça repart

Highlighted
Occasional Contributor

Re: How to read the ContentText value from an object property

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.

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors