0

Here's a site I've encountered. Note that the "Welcome" string is truncated. My screen isn't narrow at all: it's more than 1000px wide. Screenshot

The Chrome browser's inspect tool says that the "Welcome" string isn't truncated at all. It's in a <span>:

<span>Welcome</span>

To test the potentially truncated strings like this, I cannot just query the DOM. What are the tools and libraries available in the software testing industry to catch such undesirable modifications by the front end library?

  • 1
    It hasn't been truncated by a front-end library, if you're seeing the whole word in the DOM, just by the styling. – jonrsharpe Apr 1 at 19:03
1

You can check that the text-overflow is not ellipsis with WebDriver/Selenium.

In Python:

assert element.value_of_css_property("text-overflow") != "ellipsis"

in Java:

element.getCssValue("text-overflow")

https://seleniumhq.github.io/selenium/docs/api/dotnet/html/M_OpenQA_Selenium_IWebElement_GetCssValue.htm

  • Thanks. I've confirmed that the css property "text-overflow" is applicable in my case. – Anonymous Apr 1 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.