Selenium Web Driver - How can I find elements with tag name and class name together [closed] Selenium Web Driver - How can I find elements with tag name and class name together [closed] selenium selenium

Selenium Web Driver - How can I find elements with tag name and class name together [closed]


By using css selector one can combine the criteria. If you want to find button say has below html

<button class="buttonclass" />

Then following code should select the button

private By button = By.cssSelector("button.buttonclass");driver.findElement(button).

css selector above in general format is

tag.classname