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
  • 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, 2019 at 19:03

1 Answer 1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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