/Copy/).click." />

Locating a LI element using :text using watir-webdriver?

This worked for me: browser. Div(:id => "Attributes-menu"). Li(:text => /Copy/).click.

– Alastair Montgomery May 10 at 11:50 As we have discussed on Twitter, replace /Copy/ with /#{variable_name}/. :) – Željko Filipin May 10 at 12:55 to get a regex inside a variable create a new instance of a regex opbject. Meh let me add an answer – Chuck van der Linden May 11 at 18:46.

The reason it's not found is the nbsp;'s. In addition to Željko's regexp solution, you should be able to do this by adding the Unicode bytes for a non-breaking space to the string you're looking for, e. G: browser.Li(:text => "\xc2\xa0\xc2\xa0\xc2\xa0Options...\xc2\xa0\xc2\xa0\xc2\xa0").

To do Zeljko's solution but using a string variable you need to create a new instance of the regular expression class from your string variable searchtext = Regexp. New(mystringvariable) browser. Div(:id => "Attributes-menu").

Li(:text => searchtext). Click for more info see the Rdoc for the Ruby Regexp class.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions