StandardNerd
StandardNerd

Reputation: 4183

capybara find regex results in DOM Exception 12

the following works:

find("#delete-category-link")

i want also to find 'delete-category-link-8' or 'delete-category-link-9'.

when i try with regex ^:

find('#^delete-category-link')

or

find('id^="delete-category-link"')

i get

Capybara::Webkit::InvalidResponseError:    
SyntaxError: DOM Exception 12 

What am I doing wrong?

Upvotes: 1

Views: 643

Answers (1)

Justin Ko
Justin Ko

Reputation: 46836

The attribute selectors need to be enclosed by the [ and ]. It should be:

find('[id^="delete-category-link"]')

Upvotes: 3

Related Questions