Reputation: 1661
Trying to understand how to convert this Xpath to CSS locator.
//div[@id='State']//input[@class='state-dropdown list']
Upvotes: 2
Views: 1905
Reputation: 2799
Try with:
div#State * > input.state-dropdown.list
For more reference follow the link:
http://www.w3schools.com/css/css_combinators.asp
Upvotes: 0
Reputation: 23805
//div[@id='State']//input[@class='state-dropdown list']
The valid cssSelector
for this xpath
would be :-
div#State input.state-dropdown.list
CSS #id Selector
use to locate an element with their id attribute value
CSS element element Selector
use to locate element that is inside paranet element. In your case, cssSelector
would be locate <input>
elements that would be inside <div>
element.
CSS .class Selector
use to locate an element with their class attribute value
Upvotes: 1
Reputation: 4832
the cssSelector for above xpath is
div#State input.state-dropdown.list
here # represents id
and . represents class name
.
Upvotes: 1