Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
7 years ago

get Text thru Xpath

Hello,

 

I'm trying to get the text value from a cell in a table. 

I can get to the cell and click on the available links, but when I'm trying to read the content of the cell, it doesn't help.

 

here's what I'm trying to use: 

var element = page.FindChildByXPath(XpathExpression)
var tempNum  = element.getAttribute("value");

 Still can't fetch any value using getAttribute method. is there any other method that would help?

 

any help would be appreciated!

Thank you

Abhi

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Abhi,

     

    Can you provide here html markup for this given cell?

    (Or, even better, for the whole table, as I am wondering about the reason to use XPath but not Cell object provided by TestComplete for html tables.)

    • Adagio's avatar
      Adagio
      Frequent Contributor

      Hi Alex, The only reason I'm using xpath is because of Custom Tables in AngularJS app. So, recognizing these individual cells is a difficult. But I still wanted to find out how to get text of an xpath. particularly, in this scenario it'd be really helpful.

       

      Thank you

      Abhi