简体   繁体   中英

How to check if a <td> element has got colspan attribute in Angular+Protractor e2e testing with typescript

How to check if a element has got colspan attribute in Angular+Protractor e2e testing with typescript

i tried the following, but doesnt seems to be working

const colspan = await cols[0].getAttribute('colspan');

have you tried switching the way you locate the element?
I don't know how you declared cols but I assume you could do something like this:

const colspan = await cols.get(0).getAttribute('colspan');

Also share the html element and what error it throws you so we can help you better

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM