The link can be displayed by another element (for example, a pop-up window) or activated by Ajax some time after the page loads. It greatly depends on which page you are working with.
As general advice, I would recommend using crawlers directly, for example:
# Note :visible => true, it will throw an error if element is overlapped find(:xpath, "//a[.='some existing text']", visible: true).click # Another approach wait_until(15) { first(:xpath, "//a..", visible: true) }.click
nattfodd
source share