Reputation: 198
I have the following HTML code:
<input type="submit" value="Publish" class="button submit">
I have written xpath as below:
//input[@value='Publish']
//input[@class='button submit']
//input[@type='submit']
What is the corresponding cssSelector for the above xpath for using in Selenium RC or WebDriver test?
Upvotes: 2
Views: 4189
Reputation: 37746
xpath cssSelector //input[@value='Publish'] input[value=Publish] //input[@class='button submit'] input.button.submit //input[@type='submit'] input[type=submit]
Upvotes: 3
Reputation: 245
in order to select your input element you have to write somthing like this
input[type=submit] {
color: red;
}
the syntax is quite similar to xpath
input[att=val]
- Match when the element's "att" attribute value is exactly "val"
Upvotes: 1