Released Selenide 6.4.0

Released Selenide 6.4.0

Reports empty space
07.04.22


Good evening, friends!


We released Selenide 6.4.0.


Now we show both alias and locator on test failure

In Selenide, you can use method as to give web elements readable names.
It may be useful when the element has no good ID/class, and you have no choice but write long ugly unreadable xpath. It’s hard to read such selectors in reports.

Sample usage of as:

$x("/long/ugly/xpath/div[2]/span[3]/li[4]").as("Login button").click();

We always had a dilemma: should Selenide

  1. show only alias (pros: easily readable, cons: locator is not visible - but it might be helpful)
  2. show both alias and locator (pros: locator is visible, cons: hard to read).


Finally, we realized what is the right way.

Starting from version 6.4.0, Selenide will:

  1. Show only alias in reports (@TextReport, Allure report etc.)
  2. Show both alias and locator in error message in case of test failure

For example, the code mentioned above will look like this in report:

+----------------------+--------------------+------------+------------+
| Element              | Subject            | Status     | ms.        |
+----------------------+--------------------+------------+------------+
| Login button         | click()            | FAIL       | 206        |
+----------------------+--------------------+------------+------------+

And in error message:

Element "Login button" not found {By.xpath: /long/ugly/xpath[1][2][3]}
Expected: exist
Screenshot: ...

See issue 1765 and PR 1766.


Added spaces in Selenide report

The report mentioned above looked like this until now:

+---------------------+-------------------+------------+------------+
|Element              |Subject            | Status     | ms.        |
+---------------------+-------------------+------------+------------+
|open                 |https://google.com/some-long-url.html?q=selenide|PASS       |1285       |
|Login button         |click()            | FAIL       | 206        |
+---------------------+-------------------+------------+------------+

The problem is that the long URL is wrapped with | characters on the left and right. It makes it impossible to easily select it with double click. Now a space will be added to the left and right of the URL and other values in the report.

And the report looks now nicer, right?

See issue 1764 and PR 1767.


Upgraded to Selenium 4.1.3

See Selenium changelog and PR 1759.


Andrei Solntsev

selenide.org

07.04.22