Reputation: 306
I am checking a label with text like
user's email can't be blank
I am testing it as follow:
assert_selector(:xpath,"//label[text()[contains(.,'user''s email can''t be blank')]]")
but it is not working.
Also I tried this:
assert_selector(:xpath,"//label[text()[contains(.,'user\'s email can\'t be blank')]]")
Can some please tell me how to check for selector?
Upvotes: 0
Views: 56
Reputation: 474231
How about you reverse the quotes:
assert_selector(:xpath, '//label[contains(., "user\'s email can\'t be blank")]')
Upvotes: 1