Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 19 21:16
    bereg2k synchronize #1567
  • Sep 19 12:36
    bereg2k synchronize #1567
  • Sep 19 12:30
    bereg2k opened #1567
  • Sep 19 09:22
    Neboyarsky commented #675
  • Sep 18 23:07
    asolntsev synchronize #1566
  • Sep 18 23:07

    asolntsev on fokinp-refactor_text_conditions

    #1313 make SelectedText extend … (compare)

  • Sep 18 22:44
    asolntsev edited #1566
  • Sep 18 22:42
    asolntsev opened #1566
  • Sep 18 20:15

    asolntsev on fokinp-refactor_text_conditions

    Move common text conditions log… Move ExactText condition tests … Move CaseSensitiveText conditio… and 7 more (compare)

  • Sep 18 15:23
    asolntsev synchronize #1313
  • Sep 18 15:03

    asolntsev on master

    #1560 un-deprecate method Eleme… (compare)

  • Sep 18 15:03

    asolntsev on undeprecated-get-self

    (compare)

  • Sep 18 15:03
    asolntsev closed #1565
  • Sep 18 15:03
    asolntsev closed #1560
  • Sep 17 20:40
    asolntsev labeled #1565
  • Sep 17 20:40
    asolntsev unlabeled #1564
  • Sep 17 20:40
    asolntsev demilestoned #1564
  • Sep 17 20:40
    asolntsev commented #1564
  • Sep 17 20:38
    asolntsev closed #1564
  • Sep 17 20:38
    asolntsev milestoned #1565
Andrei Solntsev
@asolntsev
@nestekon yes, pass root to Panel2 constructor. Simple, stable, readable. No magic, no annotations. Just works.
@spluft_gitlab what is the question? enabled means the absence of disabled attribute. You can just look into source code. It's an open-source project.
nestekon
@nestekon
@asolntsev Totally agree with that. So in our project we've decided to keep everything in this way. And for containers we've used Selenide's ElementsContainer as the super class. But now it turns out that this class is intended to be used only with annotation approach.
Andrei Solntsev
@asolntsev
Basically you can use ElementsContainer for any purpose, but I don't see a big point in it. Probably I am just missing something...
nestekon
@nestekon
@asolntsev Yes, that's not a big point in it. Just because in one of the latest releases setSelf()was deleted I wondered what are the alternative ways to init ElementsContainer
Madhu Palagani
@MadhuPalagani_twitter
I am facing issue... if i assign Configuration.browserSize in only one test case and running tests through testng xml, selenide considering the browsersize value for other test cases also(might be if test run in same thread) ... Note - Using version 5.18.1
Madhu Palagani
@MadhuPalagani_twitter
i am running test cases on selenium grid
Andrei Solntsev
@asolntsev
@MadhuPalagani_twitter Yes, it’s because Selenide opens the browser only once and reuses it between tests.
If you really need to set browser size only in one test, you can just close the browser before and after this test.
But I recommend to always set browserSize to some value. Otherwise your browser size will depend on the screen size of current machine, which can make your tests flaky.
Madhu Palagani
@MadhuPalagani_twitter
@asolntsev Thank you, But i can see the same issue even i close the browser (closeWebDriver()) in testng beforemethod() and aftermethod()
Andrei Solntsev
@asolntsev
@MadhuPalagani_twitter of cause! Because Configuration.browserSize is STATIC. Once set, it stays forever.
Andrei Solntsev
@asolntsev

Released Selenide 5.19.0: "Independence day!"

https://selenide.org/2021/02/24/selenide-5.19.0/

Andrey Kolesnyk
@trugaaa
@asolntsev Hi, I am trying to make logging while browser init, but have faced a problem that no browser is attached to Thread while open() method is not invoked
For logs i use this construction: Log.log.info("Web driver initialisation with configuration:\n${(WebDriverRunner.getWebDriver() as RemoteWebDriver).capabilities}")
if i use it after open method it works fine but if not i get exception
is there a way to use logging while configuring stage?
image.png
My configuring class looks this way
Andrei Solntsev
@asolntsev
Sure, just use method if (WebDriverRunner.hasWebDriverStarted()) {…}
Andrey Kolesnyk
@trugaaa
@asolntsev As I understand, it will help me with exception, but i won't see logs because before open() invoke there is no driver started
(
Andrei Solntsev
@asolntsev
@trugaaa Yes, of course. How do you want to log browser properties when browser is not opened yet?
Andrey Kolesnyk
@trugaaa
maybe there is a way to init browser before open() method?
if there is a way to do this, as i understand it will make tests not to be multithread in future?
Andrey Kolesnyk
@trugaaa
or as I understand, I configure some global settings in Configuration class, mb I can somehow log this, or other Selenide Config class?
Andrei Solntsev
@asolntsev
Yes, it's probably possible, but don't you want to simplify things?
You can just enable webdriver logs. Webdriver already writes all its properties out if the box.
Andrey Kolesnyk
@trugaaa
Hello, i have a question) is it possible to implement crossbrowser testing with selenide(1 thread - chrome. 2 thread - firefox) via testng
as I understand Selenide Configuration.browser static property dont accept to do it via this property as it is static and is used for all threads
is there a way to do this in such way?
Andrei Solntsev
@asolntsev
Hi.
I typically recommend to create separate tasks (in gradle) or profiles (in Maven) for different browsers. This way you can run cross-browser tests either in parallel or sequentially; you can have separate Jenkins jobs for different browsers; it's easier to track their statuses etc.
Andrei Solntsev
@asolntsev
Andrey Kolesnyk
@trugaaa
@asolntsev thanks for answer) i will do this way, but for my understanding it is not possible to impl crossbrowser testing in one task via selenide because it runs with static Configuration
Andrey Kolesnyk
@trugaaa
More question)
This is part of my code:
Gradle.kts
tasks.withType<Test> {
    testLogging {
        showExceptions = true
        exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
        ignoreFailures = true
        reports.html.isEnabled = false
    }
    useTestNG {
        //listeners.add("listeners.TestListener")
        suiteXmlFiles.add(File("src/test/resources/testng.xml"))
    }
    //Allure results folder can be also set here but then allure.properties file is necessary for separate test allure results
    //See - https://github.com/allure-framework/allure-java/issues/505
    //System.setProperty("allure.results.directory", "$buildDir/allure-results")
}

task<Test>("chrome") {
        System.setProperty("selenide.browser", "chrome")
}

task<Test>("firefox") {
        System.setProperty("selenide.browser", "firefox")
}
When I use command gradle clean firefox
tests opens in chrome browser it seems like sys prop is not checked by selenide conf or smth
also command gradle clean test -Dselenide.browser=firefox doesnt work
Andrei Solntsev
@asolntsev
@trugaaa To previous question:
  1. you still can run cross-browser tests with one task, if you fork parallel tests (run tests in parallel processes, not threads)
  2. You can even use different browsers inside the same JVM with help of SelenideDriver, see https://selenide.org/2018/10/10/selenide-5.0.0/
  3. There is a feature request to make Configuration.browser thread-local instead of static: selenide/selenide#1372 (not implemented yet)
About your gradle script:
  1. You need to run gradlew firefox, not gradle clean test -Dselenide.browser=firefox
  2. The problem is that gradle and tests are executed in different JVMs.
    Instead of System.setProperty("selenide.browser", "firefox”) (which sets system property to gradle itself), you need systemProperties['selenide.browser'] = ‘firefox’ (which sets system property to the tests JVM).
Andrey Kolesnyk
@trugaaa
Thanks a lot!
I will try it tomorrow, hopes that with gradle dsl it will work fine
Andrey Kolesnyk
@trugaaa
It worked! thanks a lot!
Madhu Palagani
@MadhuPalagani_twitter
Hi Team,
executeJavaScript("return dataLayer.length") - working fine
executeJavaScript("return dataLayer") is returning stale element exception. any work around plz
Andrei Solntsev
@asolntsev
Hi. It seems your question is not related to Selenide.
Oser
@MarsOu1998
Hi,Why use Selenide to download file will generate a folder,I dont want it,please help.
image.png
my pom.xml