Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:07
    asolntsev milestoned #1470
  • 21:07
    asolntsev assigned #1470
  • 21:07
    asolntsev opened #1470
  • 21:01
    asolntsev unlabeled #1430
  • 21:01
    asolntsev assigned #1430
  • 21:01
    asolntsev unassigned #1430
  • 21:01
    asolntsev milestoned #1430
  • 19:43

    asolntsev on lazy-loading-in-javadoc

    #1430 improve description of la… (compare)

  • 19:40
    asolntsev edited #1430
  • 18:37
    asolntsev milestoned #1455
  • 16:06

    asolntsev on master

    Update dependencies.gradle upd… (compare)

  • 16:06
    asolntsev closed #1469
  • 16:06
    asolntsev milestoned #1469
  • 16:05
    asolntsev labeled #1469
  • 16:05
    asolntsev assigned #1469
  • 16:05
    asolntsev review_requested #1469
  • 14:25
    anilreddy edited #1469
  • 14:25
    anilreddy edited #1469
  • 14:25
    anilreddy edited #1469
  • 14:23
    anilreddy commented #1468
Andrei Solntsev
@asolntsev
Something like
File theDownloadedFile = $(“input#cv”).download();
PDF pdf = new PDF(theDownloadedFile);
assertThat(pdf, containsText(“expected text here…”);
Oser
@MarsOu1998
It's glad to see your reply . Actually, I tried the way you provided yesterday , but we use js method( onClick() ) to download file
image.png
my code:
        File file = $("#mainDiv > div:nth-child(2) > div:nth-child(5) > a").download();
Here is the error:
Message: java.lang.IllegalArgumentException: The element does not have href attribute: <a class="image_button" onclick="ECUExcel()" type>Export</a>
Andrei Solntsev
@asolntsev
Ok, then try to set Configuration.fileDownload = FOLDER; somewhere in the beginning of your tests.
Oser
@MarsOu1998
Thanks, I just tried, but it doesnt seem work ,it still generates a folder even if I specify a filea path
        Configuration.fileDownload = FOLDER;
        Configuration.downloadsFolder="tests";
        Configuration.startMaximized = true;
        Configuration.timeout = 20000;
        System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
        Configuration.browser = "chrome";
image.png
image.png
image.png
Andrei Solntsev
@asolntsev
@MarsOu1998 Once again, it MUST generate folder. It’s ok. You just don’t need to search any files in any folders. Just use the returned File.
Oser
@MarsOu1998
Sorry, I dont get it.When I download a file ,it will be stored on my computer disk, if I want to open it, shouldn't I specify the path?
What does "returned File" mean
Andrei Solntsev
@asolntsev
No, you shouldn’t specify any paths.
Once again:
    File file = $("#mainDiv > div:nth-child(2) > div:nth-child(5) > a").download();
    //    … this “file" is your downloaded file. No need to search it anywhere.

    // for example, you can read it:
    try (FileReader in = new FileReader(file)) {

    }

   // or get its full path:
   String path = file.getAbsolutePath();
Oser
@MarsOu1998
OMG!!It works!! You are the best person I've ever met!! Thanks for your help and sorry to bother you for so long.
Andrei Solntsev
@asolntsev
Thank you :)
Oser
@MarsOu1998
It's late at night in China, wish you a good dream tonight.
Andrei Solntsev
@asolntsev
Yes, it’s the goal of Selenide: to solve all generic technical details for you, so that you could focus on your project-specific business logic.
Oser
@MarsOu1998
ok,love u
Andrei Solntsev
@asolntsev

We released Selenide 5.20.1: "Mmm hmm, a killer feature!”

https://selenide.org/2021/03/23/selenide-5.20.1/

tann200
@tann200
Hey, how would I make sure, that selenide doesn't share session over tests?
I had to turn off parallel exections, because I had similar tests running and one test got sso session from the other test :D
Andrei Solntsev
@asolntsev
Hi @tann200 .
For sure, Selenide uses different browsers in different threads. They don't share any state.
But if you run several tests sequentially (in one thread), then they reuse the same browser. It's the default Selenide behaviour, but you can change it if needed.
I usually recommend to clean cookies, cache, localStorage etc. before every test.
tann200
@tann200
Weird, I run tests in parallel and if one test does the login, then the other, in separate class is already logged in.
so 2 classes, both open their own browser. If one test passes the authentication step and the other starts after that, then the other browser already has authentication. I also have clear cache and clear local storage after opening the base url
Andrei Solntsev
@asolntsev
Are you talking about 2 classes running in parallel - which means in 2 different threads?
Then no, they have two different browsers. They cannot influence each other.
Dai Pham Ngoc
@daipn1859
@asolntsev How could we record a video if a test is failed with Allure reporter?
Andrei Solntsev
@asolntsev

@daipn1859 This question is not related to Selenide.

However, there are multiple ways to save a video.

  1. https://automation-remarks.com/video-recorder-java/
  2. Selenoid (or any other docker container with browser+video support)
tann200
@tann200
@asolntsev, yes separate classes, separate browsers. Somewhere some session data is kept or maybe our sso is broken.
tann200
@tann200
isnt it same as I would have 2 separate chrome windows?
Andrei Solntsev
@asolntsev
Yes, it's the same. You do have 2 separate chrome windows.
tann200
@tann200
it might be something in selenium grid
locally all fine, but in grid fails. Though grid has each browser in own pod and 1 instance at a time
Andrei Solntsev
@asolntsev
yes, I guess it might be something it Grid, or in your test framework.
Oser
@MarsOu1998
Hi, how to automate Highcharts with Selenide
Andrei Solntsev
@asolntsev
@MarsOu1998 Sorry, I don’t have such an experience.
Oser
@MarsOu1998
@asolntsev I use actions().clickAndHold(Element).moveByOffset(x,y).release().perform() and check if the data is displayed on the page , it works perfectly
Andrei Solntsev
@asolntsev
great.
Madhu Palagani
@MadhuPalagani_twitter
Can we run selenide tests on selenium grid 4 beta versions with remote driver ?
Andrei Solntsev
@asolntsev

Hi. Not yet. Selenium 4 is not backward-compatible.

Once Selenium 4 is released, we will immediatelly release a new Selenide version compatible with it.

tann200
@tann200
I have a question about Allure logging
does Allure put every selenide action now in it's steps?