如何只在div中获取文本,而不是关于TestCafe中的任何内部标签

问题描述 投票:1回答:1

我只需要文本护理间隙,将选择器用作div。Patient-contact-popup li.nav-item a,其结果为Gare in Care1。选择器的方式/方式是什么,仅获取文本部分,而不获取任何数字,因为它是动态更改的。

Please refer the attached screenshot, for more details

testing css-selectors automated-tests testcafe ui-testing
1个回答
3
投票

您可以使用childNodes DOM属性和TestCafechildNodesAPI来实现所需的行为。以下测试示例演示了此方法:

ClientFunction
© www.soinside.com 2019 - 2024. All rights reserved.