Reputation: 95
I've been using Capybara
for 3 days now, and I have encountered a problem.
There is a html code:
<span id='some_id'> Text </span>
I need to change the Text with Capybara
. Is it possible?
Upvotes: 3
Views: 1300
Reputation: 3697
You should be able to use execute_script
:
page.execute_script("$('span#some_id').html('New Text');")
This assumes you have JQuery. If not, then substitute the script inside to whatever framework you're using.
Upvotes: 5