cancel
Showing results for 
Search instead for 
Did you mean: 

Reading list data in an xpath using TC

SOLVED
Highlighted
Contributor

Reading list data in an xpath using TC

Can you help me with how to read the list data from an xpath //*[@id="panelbar"] present in a webpage and store it in array/list using testcomplete, there is data in //*[@id="panelbar"]/li[1],  //*[@id="panelbar"]/li[2] and so on, ineed to store these data in an array/list

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Hi,

 

As per https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256086(v=vs.100), I think that XPath should be something like this:

//*[@id="panelbar"]/li

 

However, as Marsha wrote, unless you are considering cross-platform testing, search methods provided by TestComplete (FindAllChildren(), etc.) are much more preferable.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Are you required to use xpath?

Tags (1)
Highlighted
Contributor

Yes

 

Highlighted
Community Hero

Hi,

 

As per https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256086(v=vs.100), I think that XPath should be something like this:

//*[@id="panelbar"]/li

 

However, as Marsha wrote, unless you are considering cross-platform testing, search methods provided by TestComplete (FindAllChildren(), etc.) are much more preferable.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Community Manager

Thank you Alex and Marsha!

 

@abishekhari007 did you give this suggestion a try?


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
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

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

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

Participate!

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

Participate!
Top Kudoed Authors