lundi 4 novembre 2019

How do I extract the underlying HTML dom element from a TestCafe Selector?

I'm trying out TestCafe and having problems locating some of my elements. I want to be able to, for debugging purposes, print out whatever element(s) that TestCafe has found with a particular Selector so I can compare them against the DOM that exists.

I have already tried reading the documentation and running this code:

const a = await Selector('span', { timeout: 20000 }).withText('some text');
console.log(a);

However, when I run this code, all I get is a printout of some internal TestCafe type like so:

[Function: __$$clientFunction$$] {
  with: [Function],
  nth: [Function],
...
}

Aucun commentaire:

Enregistrer un commentaire