Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 22 23:34
    asolntsev milestoned #1489
  • Jun 22 23:34
    asolntsev review_requested #1489
  • Jun 22 23:34
    asolntsev assigned #1489
  • Jun 22 23:34
    asolntsev opened #1489
  • Jun 22 23:33

    asolntsev on add-task-to-publish-jar

    fix command `./gradlew` - now i… (compare)

  • Jun 22 23:32
    asolntsev review_requested #1488
  • Jun 22 23:16
    asolntsev milestoned #1488
  • Jun 22 23:16
    asolntsev labeled #1488
  • Jun 22 23:16
    asolntsev opened #1488
  • Jun 22 23:16

    asolntsev on add-support-for-okhttp4

    add support for okhttp 4.9.1 *… (compare)

  • Jun 22 17:26

    BorisOsipov on fix_jitpack

    Fix jitpack builds4 (compare)

  • Jun 22 17:00

    BorisOsipov on fix_jitpack

    Fix jitpack builds3 (compare)

  • Jun 22 16:15

    BorisOsipov on fix_jitpack

    Fix jitpack builds2 (compare)

  • Jun 22 16:09

    BorisOsipov on fix_jitpack

    Fix jitpack builds (compare)

  • Jun 22 08:13
    dbudim synchronize #1478
  • Jun 22 08:12
    dbudim synchronize #1478
  • Jun 21 18:21
    BorisOsipov commented #1162
  • Jun 21 18:17
    berrezzka commented #1162
  • Jun 19 10:58
    PavelOnz commented #1486
  • Jun 19 10:57
    PavelOnz commented #1486
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);
Arsen Papoyan
@arsen.papoyan:matrix.org
[m]

asolntsev (Andrei Solntsev):
I got you.
We have handled it in this way:

private MyPage radioButtonCheck(SelenideElement element, int index) {
        Checked myChecked = new Checked() {
            @Override
            public boolean apply(Driver driver, WebElement element) {
                String f = String.format("return document.querySelectorAll('[type=radio]')[%s].checked", index);
                return Selenide.executeJavaScript(f);
            }
        };
        element.shouldBe(myChecked);
        return this;
    }

    @Step
    public MyPage depositCheck() {
        depositRadioButton.click();
        radioButtonCheck(depositRadioButton, 0);
        return this;
    }

Now I can use "radioButtonCheck" method for all radio buttons.
What do you think?

Andrei Solntsev
@asolntsev
Well, yes, you can check.
Vlad-Titov
@Vlad-Titov

Not sure if this is a right place to ask but I'm getting following error when I'm trying to run tests
com/codeborne/selenide/Configuration java.lang.NoClassDefFoundError: com/codeborne/selenide/Configuration at configuration.TestBaseClass.SetUpAll(TestBaseClass.java:12) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
Using gradle 7.0 I have following dependencies:

plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
    testImplementation 'com.browserup:browserup-proxy-core:2.1.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
    testCompileOnly 'com.codeborne:selenide:5.20.1'
    testCompileOnly 'org.apache.logging.log4j:log4j-api:2.14.1'
    testCompileOnly 'org.apache.logging.log4j:log4j-core:2.14.1'
    testCompileOnly 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1'
}

test {
    useJUnitPlatform()

    reports {
        junitXml.enabled = true
        html.enabled = false
    }
}

Any ideas why it's not being initialized?

Andrei Solntsev
@asolntsev
@Vlad-Titov You need to read all the logs and find the very first error.
Typically NoClassDefFoundError: com/codeborne/selenide/Configuration means that some error happened during the initialization of class Configuration, that’s why JVM could initialize this class. Since then, every call to Configuration throws NoClassDefFoundError.
Vlad-Titov
@Vlad-Titov
Thanks for the answer. The problem was in testCompileOnly 'com.codeborne:selenide:5.20.1', it has to be testImplementation
blick882
@blick882

Hi!
I'm trying to use Selenide for mobile apps(this one is for iOS). Cannot scroll down to the element

    open fun `open login page`(): HowToPage {
        LOGIN_BUTTON.scrollIntoView(true)
        LOGIN_BUTTON.shouldBe(appear)
        LOGIN_BUTTON.click()
        return HowToPage()
    }

It fails and says

Element not found {By.id: Log in}

But the element is clickable and visible to other methods. click() works fine.
How can I just scroll down?

Andrei Solntsev
@asolntsev
@blick882 I guess $.scrollIntoView is web-specific and does not work in mobile apps. You need to Google how to scroll in appium.
Madhu Palagani
@MadhuPalagani_twitter
image.png
Please help me to resolve below
Is it possible to handle (allow/block) the location popup for chrome
By using any configuration setting
Andrei Solntsev
@asolntsev
Afaik you cannot click “Allow” or “Block”.
Instead, you need to enable or disable location by some chrome options when you start a webdriver.
brandonrock919
@brandonrock919

Hi,
I have an issue i want to upload image to website on remote selenoid machine
on selenium this code worked for me

        ((RemoteWebElement) profilePic).setFileDetector(new LocalFileDetector());
        profilePic.sendKeys(profileImage);

but no i dont have idea why its not working
anyone maybe can assist please ?