Hi all!
We released Selenide 3.9.1!
We planned to do it for a long, and now it finally happened! Those endless problems with downloading files in Selenium are over. Now it’s easy. Just one simple method for all cases:
File report = $("input#submit").download();
Actually method download existed in Selenide for a long time. But it could only download files from links with href attribute: <a href.
It was good, but not enough in some cases. For example:
Now Selenide can download any files in all these cases. To make it possible, Selenide run a built-in proxy server (namely, BrowserMobProxy).
$("selector").download();Content-Disposition. Selenide extracts file name from this header, and saves corresponding file to folder build/reports/tests.$.download() return the first downloaded file.See issue #196 and pull request #267.
Huge thanks to Dmitrii Demin for his commitment to this feature, suggestions and discussions!
Yes, now Selenide runs its own proxy server when running tests.
In future we can use it for implementing other useful features. For example, we could check http statuses of pages and other resources. We could inject own code into pages etc.
Please share your ideas, let’s brainstorm!
Now Selenide tracks size of requests and responses. If some of them exceeded 2 MB, Selenide will write a warning in logs.
This is experimental feature. Please share your experience with it. Dd you get new knowledge? Did you have some problems with it?
See issue #383
SoftAsserts listener works correctly with TestNGWe found that TestNG is a bad boy. Really, it has some really weird issues. For example, if you declare@Listeners(SoftAsserts.class) in some of your test classes, TestNG will automatically applySoftAsserts listener to all of your tests. Unbelievable!
We created a workaround for this problem. Now SoftAsserts listener will check if the current test (or its parent) really declares annotation @Listeners(SoftAsserts.class).
See issue #384
SoftAsserts TestNG listener ignores tests with attribute “expectedExceptions”Let me describe the problem. Suppose you have a test:
@Listeners(SoftAsserts.class)
public class MyTest {
@Test
public void myCheckA() {...}
@Test(expectedExceptions = ...)
public void myCheckB() {...}
}
Obviously, SoftAsserts mode should be used in method myCheckA, but should not be used in methodmyCheckB. Because myCheckB expects some specific error, and SoftAsserts would break the whole flow if it caught the error.
See issue #372
See issue #366 and pull request #369
Thanks to Anton Aftakhov for this pull request!
Selenium uses quite old gson 2.3.1, but sometimes you want to use a newer one.
Let’s upgrade!