> > If you try to use something like browser.link(text: "Services").click, it > says: > > "element located, but timed out after 30, seconds." >
The problem here is that there are actually 2 services links on the page. One is in the mobile nav menu (when the browser width is small) and one is in the full site menu (when the browser with is wide). `browser.link` grabs the first matching element, which in this case is the one in the nav menu. The element exists, but never becomes visible. Depending on what browser width you want to work with, you need to either: 1. Expand the menu (for smaller browser widths): browser.div(id: 'mob-burger-trigger').click browser.link(text: 'Services').click 2. Click the visible (or second) services link (for wider browser widths): browser.link(text: 'Services', visible: true).click If I do the more generic element: browser.element(link_text: > "Services").click, I get: > > "timeout after 30 seconds." (So it just couldn't find it at all.) > Interestingly, :link_text appears to take into account the text styling. If you view the source, the HTML text is just "Services". However, there is a style applying a text-transform which makes it look like "SERVICES" in the UI. The :link_text locator appears to consider the transform. As a result, you need to use the capitalized value: browser.element(link_text: 'SERVICES').click -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.