I’m using selenium webdriver to write tests, and the following code returns the error message “Failed assertion, no message given.”:
product_name_error_message = @driver.find_element(:tag_name => "span", :class => "error").text
assert product_name_error_message == "Product Name must be greater than 3 and less than 255 characters!"
Sorry, I’m a newbie to Ruby and I couldn’t find any solutions for this error message on the web. I’ve checked with a browser, this text does appear on the page, and with the proper span tag and class. It’s just that the selenium webdriver can’t find this element, and throws this inconclusive error. Help?
Try displaying what value is returned after you run your first line of code.
So
I reckon that variable does not hold that value anyways.
Also you could club all in one line –