Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 21 21:06
    BorisOsipov assigned #1619
  • Oct 21 21:00
    asolntsev synchronize #1618
  • Oct 21 21:00

    asolntsev on improve-and-or-actual-value

    make output of "and" and "or" c… make output of "and" and "or" c… #1581 improve format of actual … and 2 more (compare)

  • Oct 21 20:53
    asolntsev commented #1593
  • Oct 21 20:52
    asolntsev closed #1612
  • Oct 21 20:52

    asolntsev on split-to-artifacts

    (compare)

  • Oct 21 20:52

    asolntsev on master

    * #1593 Publish Selenide as sep… (compare)

  • Oct 21 20:52
    asolntsev closed #1593
  • Oct 21 20:46
    asolntsev synchronize #1618
  • Oct 21 20:46

    asolntsev on improve-and-or-actual-value

    #1581 improve format of actual … (compare)

  • Oct 21 20:41
    BorisOsipov opened #1619
  • Oct 21 20:39

    BorisOsipov on cleanup_configuration

    Cleanup configuration (compare)

  • Oct 21 19:52
    asolntsev synchronize #1618
  • Oct 21 19:52

    asolntsev on improve-and-or-actual-value

    #1581 improve format of actual … (compare)

  • Oct 21 15:04
    asolntsev synchronize #1618
  • Oct 21 15:04

    asolntsev on improve-and-or-actual-value

    make output of "and" and "or" c… make output of "and" and "or" c… (compare)

  • Oct 21 14:46
    petroOv-PDFfiller synchronize #1601
  • Oct 21 13:47
    petroOv-PDFfiller synchronize #1601
  • Oct 21 11:17
    asolntsev labeled #1617
  • Oct 21 11:17

    asolntsev on simplify-edge-setup

    (compare)

Andrei Solntsev
@asolntsev
Hi @luke-lknet .
I personally don’t have experience with Healenium,
but I know that its authors tried to integrate them, and didn’t succeed.
The main reason is that Selenide and Healenium has controversial goals. Selenide re-tries the same locator many times (up to 4 seconds), while Healenium tries to try different locators.
Andrei Solntsev
@asolntsev
BTW, we had an idea to implement similar mechanism inside of Selenide: selenide/selenide#129
Madhu Palagani
@MadhuPalagani_twitter
Hi Team,
please help me to add chrome browser extension
below is code snippet i tried
Configuration.browser = "chrome"
ChromeOptions options = new ChromeOptions()
options.addExtensions(new File("file path"))
Configuration.browserCapabilities = new DesiredCapabilities()
Configuration.browserCapabilities.setCapability(ChromeOptions.CAPABILITY, options)
open("https://www.google.com")
getting exception : org.openqa.selenium.WebDriverException: unknown error: cannot exclude load-extension switch when extensions are specified
Andrei Solntsev
@asolntsev
@MadhuPalagani_twitter what version If Selenide A
are you using?
Madhu Palagani
@MadhuPalagani_twitter
version - 5.14.0
Madhu Palagani
@MadhuPalagani_twitter
i tried with 5.17.2 selenide version. working fine.. tq
Blackwell174
@Blackwell174
Got feature idea "emulate css print media type" command so we wouldn't have to use AutoIT for that :) Helpful for doing print testing
Andrei Solntsev
@asolntsev
WOW, cool idea.
@Blackwell174 bit how to do it?
nestekon
@nestekon
Hi Team,
I have a question about dynamic locators as ElementsContainer constructors. Before latest releases I successfully used setSelf(). Now it is not clear how to resolve this structure:
public class Panel1 extends ElementsContainer {
    public Panel2 getPanel2(String title) {
        Panel2 panel2 = new Panel2();
        panel2.setSelf(getSelf().$x(".//*[text()='" + title + "']"));
        return panel2;
    }
}

public class Panel2 extends ElementsContainer {

}
Andrei Solntsev
@asolntsev
@nestekon Wow. I never understand why method setSelf is needed. And still don’t understand.
Classes extending EementsContainer (like Panel2) were not intended to instantiate manually. Instead, you should use method Page2 page = Selenide.page(Page2.class);.
You probably need something like this:
class Panel1 extends ElementsContainer {
  @FindBy(xpath = ".//*[text()='" + title + "']")
  Panel2 panel2;
}

class Panel2 extends ElementsContainer {
}
Or even better, don’t extend ElementsContainer at all. Especially if you don’t use @FindBy fields.
Just create plain old good java objects. Something like
class Panel1 {
  private final SelenideElement root = $(“.body”);
  private final Panel2 panel2 = new Panel2(root, ".//*[text()='" + title + "’]");
}

class Panel2 {
}
nestekon
@nestekon
@asolntsev Thanks for respond!
These examples seems static. The second example looks more suitable. Actually it is similar to my example where root is self, and in this way I will need some abstract class that will keep root.
Andrei Solntsev
@asolntsev
I don’t think you even need this abstract class. Why?
Let every class holds its own data.
nestekon
@nestekon
@asolntsev Every class that represent some container for elements will have root element and setter and getter for it. So it is better to keep this in some abstract class. And ElementsContainer was a good candidate for this. In anyway I want to know how it is intended to resolve the task of page.getPanel1().getPanel2(title); where title is not a constant, but is a test data.
Andrei Solntsev
@asolntsev
@nestekon can we discuss the design together tehing to find a better solution?
First If all, what If i ssy that getters/setters are not needed? You can remove them.
Andrei Solntsev
@asolntsev

Released Selenide 5.18.1: "Localhost is a delicate thing!”

https://selenide.org/2021/02/11/selenide-5.18.1/

nestekon
@nestekon
@asolntsev That's will be fine. And how will we init field of ElementsContainer type based on dynamic xpath?
In this case private final Panel2 panel2 = new Panel2(root, ".//*[text()='" + title + "’]") title can be only constant.
Andrei Solntsev
@asolntsev
It doesn't need to be a field. Create a method 'getPanel2()` instead.
nestekon
@nestekon
@asolntsev Yes. That's right. And to init Panel2we will need root element from parent container and setter or constructor to assign root element of Panel2
Nikolay Voronenko
@spluft_gitlab
Hi, everyone
Could you tell me how does element.shouldBe(enabled) work? I thought that it should check enabled/disabled attribute, but element hasn't it and this sample of code working good. I just want to understand that.
element:<div _ngcontent-spq-c121 class="steps-menu__item steps-menu__item_active ng-star-inserted">Text</div>
Also element could looks like:
<div _ngcontent-spq-c121 class="steps-menu__item ng-star-inserted">Text</div>
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?