Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74158

Getting text of all elements within a menu in testcafe

$
0
0

enter image description hereI want to get the text of all links within a menu and compare them to the expected texts. I am new to testcafe.

const all_GeneralDisplayTopLink = Selector('nav.shTop').find('ul').find('li');

async areGeneralDisplayedLinksPresent(){

let gettexts =  all_GeneralDisplayTopLink;
  var Count   = await gettexts.count;
  console.log(Count + " I need help");// this return four as expected
   for (var i = 0; i < Count; i++){
    var printText = await gettexts.nth(i).textContent;// this throwing an error.
      printText++;
      console.log(printText + " I need help2");

Viewing all articles
Browse latest Browse all 74158

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>