Released Selenide 7.10.0

Released Selenide 7.10.0

The second birthday of the video recorder
20.08.25

Head õhtut!

On August 20, Estonia celebrates its second birthday – Independence Restoration Day.

In honor of the holiday we made a release Selenide 7.10.0.

Now it’s our video recorder’s second birthday too! (it’s been heavily redesigned)


Speed up the video recorder

In the first versions of the video recorder, we used the org.bytedeco:javacv library to merge all captured screenshots into a video file.

It turned out that this is quite a slow method (and we were unable to speed it up). Instead, it is much faster to save all screenshots to a folder and then run the ffmpeg command:

ffmpeg -i screenshot.%d.png

It works very quickly (in my tests - always less than a second).

Important:

  1. Now the video recorder requires ffmpeg to be installed on the computer.
  2. The video file extension has changed from webm to mp4.

See issue 3058, PR 3071 for PR 3079.

Thanks to @Deni_Don and Aliaksandr Rasolka for brainstorming and testing hypotheses!


Screenshots for video recorder via BiDi or DevTools

Until now, the video recorder took screenshots using the standard webdriver method TakesScreenshot.getScreenshotAs.

There is a problem with it in Chrome: it steals the browser focus. This creates a flickering effect when running several browsers in parallel, and theoretically can even cause flaky tests.

Look how fun this looks! :)

BEFORE:

Now we take screenshots in an alternative way:

  • in Chromium browsers via DevTools,
  • and in Firefox via BiDi.

It turned out that it works much faster, and the focus is not lost.

AFTER:

See PR 3077.


Compile-safe scrolling $.scrollIntoView(options)

Since ancient times, Selenide has had a method for scrolling:

$.scrollIntoView("{block: \"end\"}");
$.scrollIntoView("{behavior: \"instant\", block: \"end\", inline: \"nearest\"}");

The problem is that this json parameter is from the JavaScript world. You need to know its syntax or copy from somewhere, and it is easy to make a mistake in it.

Now a similar command can be written in Java with all its blackjack, autocomplete and syntax highlighting:

$.scrollIntoView(instant().block(end));
$.scrollIntoView(instant().block(center).inline(nearest));

By the way,

  • Both old scrollIntoView methods are now @Deprecated.
  • The new API encourages the use of the instant option. It disables smooth scrolling which could sometimes cause unstable tests.

See PR 3078.


Static methods for creating containers

It’s similar to method page() that allows creating page objects. The new method container() allows creating Container instances:

class PopupA implements Container {
  PopupB next() {
    return container("#popupb", PopupB.class);
  }
}

class PopupB implements Container {
  PopupA back() {
    return container("#popupa", PopupA.class);
  }
}

Thanks to Ilya Koshaleu for PR 3053.


@DeepShadow annotation

In Selenide, we have the shadowDeepCss method for finding an element in several nested shadow doms. Now the same search can be implemented in a page object using the new annotation @DeepShadow:

class PageObject {
  @DeepShadow
  @FindBy(css = "#myelementid")
  private SelenideElement myElement;

  @DeepShadow
  @FindBy(css = ".my-elements")
  private List<SelenideElement> myElements;
}

Thanks to Ilya Koshaleu for PR 3083.


Validation of incrementTimeout

Now we check that incrementTimeout is not greater than the overall timeout for downloading the file.

Trying to call the method only with incrementTimeout parameter:

$.download(using(FOLDER)
      .withTimeout(ofMillis(4000))
      .withIncrementTimeout(ofMillis(30_000)))

will immediately give an error:

IllegalArgumentException:  
Timeout (4000 ms) must be greater than increment timeout (30000 ms)

See PR 3093.


Updated Selenium from 4.34.0 to 4.35.0

And bumped CDP version from v138 to v139.
And updated Appium from 9.5.0 to 10.0.0

Thanks to Aliaksandr Rasolka for PR 3087


Andrei Solntsev

selenide.org

20.08.25