Selenium webdriver (c#) - Finding button based on attribute

后端 未结 5 1733
渐次进展
渐次进展 2021-01-13 11:22

I\'m trying to get a handle on the button below based on the attribute gl-command. I\'m aware I can find the button using a Cssselector by locator

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 11:56

    XPath would be your safest bet.

    IWebElement glButton = driver.findElement(By.xpath("//button[contains(@gl-command, 'transaction')]));
    

    There's a similar question here: http://forum.testproject.io/index.php?topic=66.0

提交回复
热议问题