Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 16 07:59

    release-drafter[bot] on v5.20.5

    (compare)

  • May 15 19:55

    asolntsev on v5.21.0

    (compare)

  • May 15 19:55

    asolntsev on master

    upgrade to JUnit 5.7.2 upgrade to Gradle 7.0.2 release Selenide 5.21.0 (compare)

  • May 13 20:31
    asolntsev closed #952
  • May 13 20:31
    asolntsev commented #952
  • May 13 20:28
    asolntsev labeled #797
  • May 13 20:28
    asolntsev closed #913
  • May 13 20:28
    asolntsev commented #913
  • May 13 20:26

    asolntsev on master

    #1430 improve description of la… #1430 add explanation why some … (compare)

  • May 13 20:26

    asolntsev on lazy-loading-in-javadoc

    (compare)

  • May 13 20:26
    asolntsev closed #1470
  • May 13 20:26
    asolntsev closed #1430
  • May 13 14:55
    asolntsev synchronize #1470
  • May 13 14:55

    asolntsev on lazy-loading-in-javadoc

    #1430 add explanation why some … (compare)

  • May 13 11:51
    CloudWzhZzz commented #1468
  • May 13 09:29
    asolntsev commented #1468
  • May 13 06:10
    asolntsev review_requested #1470
  • May 13 04:54
    CloudWzhZzz commented #1468
  • May 13 03:56
    asolntsev closed #1468
  • May 13 03:56
    asolntsev labeled #1468
Andrei Solntsev
@asolntsev
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?
I have seen issues reported with Allure logging out passwords
now well, happening for me aswell. Is there any way to hide some selenide inputs from Allure reporting?
Andrei Solntsev
@asolntsev
Hi @tann200 .
No, Selenide currently doesn’t have methods for hiding passwords in Allure report.
@tann200 I would ask you, why do you need it? It’s just a password from test environment. It’s anyway available for all QA engineers. Why should you hide it?
Andrei Solntsev
@asolntsev
@tann200 btw, we already had such a pull request: selenide/selenide#948
tann200
@tann200
@asolntsev even if it is a test environment, then for cyberhygiene sake, it would be reasonable to not show them out in bamboo reports
Andrei Solntsev
@asolntsev
@tann200 sorry, I still don't understand. What is the real need?
If somebody is not allowed to see information about test environment, I believe he also should not be allowed to see bamboo. No?
tngii
@tngii

Hi. Our tests use proxyEnabled for FileDownload (without proxy downloading doesn't work). But site with https protocol can't be open.

For example:

public void httpsWithEnabledProxy() {
    Configuration.proxyEnabled = true;
    Configuration.fileDownload = FileDownloadMode.PROXY;
    Selenide.open("https://google.com/");
    //Result (Failed): This site can’t be reached
}

@Test
public void httpsWithoutProxy() {
    Configuration.proxyEnabled = false;
    //Configuration.fileDownload = FileDownloadMode.PROXY;
    Selenide.open("https://google.com/");
    //Result (Passed)
}

How to solve this issue?

Andrei Solntsev
@asolntsev
Usually proxy works fine with https sites because Selenide adds setting "accept all certs" (or something similar) when starting a webdriver.
Probably you have some custom code for opening a webdriver?
Another solution would be using FOLDER download mode instead of PROXY.
tngii
@tngii

Probably you have some custom code for opening a webdriver?
no customization, it's full example code:

```
import com.codeborne.selenide.Configuration;
import com.codeborne.selenide.FileDownloadMode;
import com.codeborne.selenide.Selenide;
import org.testng.annotations.Test;

public class test {

@Test
public void httpsWithEnabledProxy() {
    Configuration.proxyEnabled = true;
    Configuration.fileDownload = FileDownloadMode.PROXY;
    Selenide.open("https://google.com/");
    //Result (Failed): This site can’t be reached
}

@Test
public void httpsWithoutProxy() {
    Configuration.proxyEnabled = false;
    //Configuration.fileDownload = FileDownloadMode.PROXY;
    Selenide.open("https://google.com/");
    //Result (Passed)
}

}
'''
selenide - 5.13.0

Andrei Solntsev
@asolntsev
@tngii Nope. I just tried your code - works for me. Both with proxy and without proxy.
Could you please provide a full sample project on github, so that we could reproduce the problem?
tngii
@tngii
@asolntsev i tried to create example repo on github, but.. it works fine (i mean all tests passed).. i don't understand what is wrong with my working project
Andrei Solntsev
@asolntsev
@tngii you can enable webdriver logs (something like Configuration.webdriverLogs=true;) and double-check browser arguments.
Arsen Papoyan
@arsen.papoyan:matrix.org
[m]
Hi @asolntsev
I want to test if a radio button is selected.
The shouldBe(selected) method cannot be used, because there is no Selected property. So I decided to use JS execution in this case.
I've tried this:
Selenide.executeJavaScript("document.querySelector('#mat-radio-2-input').checked")
and how to continue to assert true or false for this?
Can you please help?
Andrei Solntsev
@asolntsev

@arsen.papoyan:matrix.org Sure, just use “return” inside of JS. Something like this:

boolean isChecked = Selenide.executeJavaScript(“return document.querySelector('#mat-radio-2-input').checked”);
assertThat(isChecked).isTrue();

P.S. Selenide has method getSelectedRadio, see working examples here: https://github.com/selenide/selenide/blob/master/statics/src/test/java/integration/RadioTest.java

Arsen Papoyan
@arsen.papoyan:matrix.org
[m]
@asolntsev: Well thank you.
I would just not want to use the Assertion API 🙂, but if there is no other option, then so.
Andrei Solntsev
@asolntsev
I agree, it would be great to add a Selenide-style api for checking radio buttons. Do you have a concrete idea how it could look like?
Andrei Solntsev
@asolntsev
@arsen.papoyan:matrix.org I found a Selenide-style check without Assertion API:
  @Test
  void assertCheckedRadioButton() {
    $(byName("me")).selectRadio("margarita");
    $("[name=me][value=margarita]").shouldBe(checked);
    $("[name=me][value=margarita]").shouldHave(attribute("checked")); // just an alternative
  }
Arsen Papoyan
@arsen.papoyan:matrix.org
[m]
@asolntsev:
That also doesn't work in my case, because only the class name is changed (mat-radio-checked is being added), but I don't want to check the selection in this way, for example, attribute class shouldhave "mat-radio-checked", I guess that's not good practice).
Do you have any idea?
Andrei Solntsev
@asolntsev
Ok, I see your “radio” button is not a standard html radio button, but some custom component.
Selenide cannot handle all possible custom components in the world, right?
You can use something like $.shouldHave(cssClass(“mat-radio-checked”)), why not?
You can also create your custom Condition and use it in all your tests:
  public static final Condition matChecked = Condition.cssClass(“mat-radio-checked”);

  $.shouldBe(matChecked);