因此,我一直在尝试挑战自己,并尝试通过使用以下代码来解决祖父母和父母使用<i class="test-object"></i>
的问题
<button do-something="" primary-button="" class="gfjhghjfghjfgfh" disabled="">
<span class="primary-button-wrapper">
<i class="test-object"></i>
<span>nice</span>
</span>
基本上,我想做的是使用javascript硒来找到grapndparent和父项(按钮和跨度)。
所以我只实现了:
const testing= await driver.findElement(webdriver.By.classname('test-project'));
console.log(await testing.getattribute('class'));