Here is the issue that has been nagging for weeks and all solutions found online do not seem to work... ie. wait for ajax, etc...

here is versions of gems:

* capybara (2.10.1, 2.7.1)
* selenium-webdriver (3.0.1, 3.0.0)
* rspec (3.5.0)

running ruby 2.2.5
ruby 2.2.5p319 (2016-04-26 revision 54774) [x64-mingw32]

**in the env.rb**

```
Capybara.register_driver :selenium do | app |
browser = (ENV['browser'] || 'firefox').to_sym
Capybara::Driver::Selenium.new(app, :browser => browser.to_sym, :resynchronize => true)
Capybara.default_max_wait_time = 5
end

```

**Here is my dynamicpage.feature**

```
Given I visit page X
Then placeholder text appears
And the placeholder text is replaced by the content provided by the json service 

```

**and the step.rb**

```
When(/^I visit page X$/) do
visit('mysite.com/productx/')
end

When(/^placeholder text appears$/) do
  expect(page).to have_css(".text-replacer-pending")
end

Then(/^the placeholder text is replaced by the content provided by the json service$/) do
    expect(page).to have_css(".text-replacer-done")
end

```

the webpage in question, which I cannot add it here as it is not publicly accessible, contains the following on page load:

```
1- <span class="text-replacer-pending">Placeholder Text</span>

```

after a call to an external service (which provides the Json data), the same span class gets refreshed/updated to the following;

```
2- <span class="text-replacer-done">Correct Data</span>

```

The problem I have with the "visit" method in capybara + selenium is that as soon as it visits the page, it thinks everything loaded and freezes the browser, and it never lets the service be called to dynamically update the content.
I tried the following solutions but without success:

1. Capybara.default\_max\_wait\_time = 5
2. Capybara::Driver::Selenium.new(app, :browser => browser.to\_sym, :resynchronize => true)
3. add sleep 5 after the visit method
4. wait for ajax solution from several websites, etc...
5. adding after hooks
etc...

I am at a complete loss why "visit" can't wait or at least provide a simple solution to an issue i am sure is very common.
I am aware of the capybara methods that wait and those that don't wait such as 'visit' but the issue is;

1. there is no content that goes from hidden to displayed
2. there is there is no user interaction either, just the content is getting updated.

also unsure if this is a capybara issue or a selenium or both.

Anyhow have insight on any solutions? i am fairly new to ruby and cucumber so specifically what code goes in what file/folder would be much appreciated.

Mel