Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:33
    evpl synchronize #1580
  • 16:13
    evpl synchronize #1580
  • 16:08
    asolntsev milestoned #217
  • 14:52
    horuktaras opened #1590
  • 10:22
    kkochetov commented #456
  • 09:50
    asolntsev milestoned #1589
  • 09:50
    asolntsev labeled #1589
  • 09:50
    asolntsev labeled #1589
  • 09:50
    asolntsev assigned #1589
  • 08:57
    cbxp opened #1589
  • 07:02
    dependabot[bot] labeled #1588
  • 07:02
    dependabot[bot] opened #1588
  • 07:02

    dependabot[bot] on gradle

    Bump okhttp from 3.12.13 to 4.9… (compare)

  • 07:02
    dependabot[bot] labeled #1587
  • 07:02
    dependabot[bot] opened #1587
  • 07:02

    dependabot[bot] on gradle

    Bump jetty-servlet from 9.4.43.… (compare)

  • 06:38
    asolntsev milestoned #1538
  • 06:38
    asolntsev demilestoned #1538
  • 06:37
    asolntsev milestoned #980
  • 06:37
    asolntsev demilestoned #980
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 ?

Andrei Solntsev
@asolntsev
@brandonrock919 Selenide uses the same code by default.
Andrei Solntsev
@asolntsev
Released Selenide 5.21.0: “Say no to duplicates!”
https://selenide.org/2021/05/15/selenide-5.21.0/
brandonrock919
@brandonrock919
@asolntsev maybe there is a issue i tried everything
when i am using selenoid docker with selenide its not uploading the file to the webiste
Andrei Solntsev
@asolntsev
@brandonrock919 You probably open webdriver by yourself?
Andrei Solntsev
@asolntsev
then you need to use LocalFileDetector:
      RemoteWebDriver webDriver = new RemoteWebDriver(toURL("http://localhost:4444/wd/hub"), options);
      webDriver.setFileDetector(new LocalFileDetector());
Boris Osipov
@BorisOsipov
@brandonrock919 also please describe what "its not working" exactly means. can you show error stacktrace?
Sajan
@woodsongem
Hello All,
I creating POC using selenide and trying to implement screenshot and video recored. screenshot is working and not able to find record video. please let me know something wrong in below code.
 ChromeOptions chromeOptions = new ChromeOptions();
            chromeOptions.addArguments("--ignore-ssl-errors=yes", "--ignore-certificate-errors", "--start-maximized");
            chrome = new BrowserWebDriverContainer()
                    .withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_ALL,
                            new File("./target/"))
                    .withCapabilities(DesiredCapabilities.chrome())
                    .withCapabilities(chromeOptions);
     if (!chrome.isRunning()) {
                chrome.start();
            }
            RemoteWebDriver driver = chrome.getWebDriver();
            WebDriverRunner.setWebDriver(driver);
Andrei Solntsev
@asolntsev
@woodsongem It seems your question is about TestContainer rather than Selenide.
Though, here you can find some examples of using Selenide with TestContainers: https://github.com/selenide-examples/testcontainers/tree/master/src/test/java/org/selenide/examples
Sajan
@woodsongem
thanks @asolntsev for your response. earlier I refer same repo and not able to identify issue.
one change I tried is new File("build") to new File("./target/")
Sajan
@woodsongem
Hello @asolntsev : how to upload file in Selenide using test container?
Andrei Solntsev
@asolntsev
@woodsongem Exactly the same as any other upload: $(“input”).uploadFile(…);
Sajan
@woodsongem

thanks @asolntsev for your response. I did same and getting below error.

Caused by: InvalidArgumentException: invalid argument: File not found :

file is outside of project and using Selenide with testContainer.

Andrei Solntsev
@asolntsev
It depends on how you create a webdriver. It's important to set LocalFileDetector if you create RemoteWebDriver by yourself.
Sajan
@woodsongem
thanks @asolntsev for your response. I am using BrowserWebDriverContainer and below is the sample code. not sure how to set setFileDetector
ChromeOptions chromeOptions = new ChromeOptions();
            chromeOptions.addArguments("--ignore-ssl-errors=yes", "--ignore-certificate-errors", "--start-maximized");
            chrome = new BrowserWebDriverContainer()
                    .withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_ALL,
                            new File("delete"),
                            VncRecordingContainer.VncRecordingFormat.MP4)
                    .withCapabilities(DesiredCapabilities.chrome())
                    .withCapabilities(chromeOptions);
                chrome.beforeTest(new TestDescriptionImpl());
                chrome.start();
Sajan
@woodsongem
thanks @asolntsev . it's worked and took little more time to identify the driver.
chrome.getWebDriver().setFileDetector(new LocalFileDetector());
Andrei Solntsev
@asolntsev
Guys, we have an anniversary release Selenide 5.22.0!
  • #1479 make it possible to check an alert before downloading a file -- see PR #1481
  • #1482 Add support for Condition.textCaseSensitive for selected options in select element -- thanks to Oleg Berezhnoy
  • #1380 Add selectors byTextCaseInsensitive and withTextCaseInsensitive -- see PR #1381
  • #1483 add method Driver.getSessionId() -- thanks to Petro Ovcharenko
  • override default Selenium http timeouts -- see PR #1433
  • #1472 refactoring: pass WebElementSource instead of SearchContext
Vladislav Voronin
@vrnvorona
Hi. I have weird problem with Safari. It won't click, or will click only once and then will throw TimeoutException. Chrome/Firefox is perfect.
Vladislav Voronin
@vrnvorona
Caused by: TimeoutException: at com.codeborne.selenide.ex.UIAssertionError.wrapToUIAssertionError(UIAssertionError.java:83) at com.codeborne.selenide.ex.UIAssertionError.wrapThrowable(UIAssertionError.java:74) at com.codeborne.selenide.ex.UIAssertionError.wrap(UIAssertionError.java:68) at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:90) at com.sun.proxy.$Proxy15.click(Unknown Source)
Andrei Solntsev
@asolntsev

Released Selenide 5.22.0:

Wake up, we have a release again!

https://selenide.org/2021/06/08/selenide-5.22.0/

Kristoffer
@krsg
Hi, I have a problem using source() with Firefox. The web page I'm testing contains some <!-- comments --> right beneath the closing html tag that I need. When using source() with Firefox those comments are missing. It works with Chrome. Does anybody know why they are missing?
Andrei Solntsev
@asolntsev
@krsg As far as I know it’s an expected behaviour. The whole point of comments is the ability to ignore them. Browsers do ignore them. source() can return html without the comments.
@krsg Why do you need to get comments? Usually it’s not needed.
Kristoffer
@krsg
Oh ok, other comments are shown though, but not these under the closing html tag
It's information about the current environment, so we use them to verify that we're in the right test environment and not in production
Andrei Solntsev
@asolntsev
I usually recommend to add such information in `<meta> tags in html.
For example, if you go to https://idemo.bspb.ru you will see build number and revision:
<html>
<head>
  <meta name="build" content="release-2021-03-30-small-stuff.64">
  <meta name="revision" content="ce2afaca56">
Or you can even add a separate URL for such information, like https://your.site.com/info
(It can be disabled in production if it’s not a public info)
Kristoffer
@krsg
Thanks! Sadly I think this is out of my control :-(
The solution works fine with Chrome. I just thought it would be nice to also run the tests with Firefox, that's when I stumbled upon the missing comments. But I think we will manage with just running Chrome.
Thanks for your help :-)
Andrei Solntsev
@asolntsev
Anyway, you can just execute a get request to get the html source. Like
```
String html = IOUtils.readUrlToString("https://your.site.com", UTF8);
Andrei Solntsev
@asolntsev
@krsg I hope this check is not a part of a functional test? It would be a wrong test design. End user might not see those comments and cannot use them. So your test shouldn't check it.
Andrei Solntsev
@asolntsev
It may be useful just as a double-check to be sure the right release was installed to the test environment. But then you don't need to check it in all browsers.
Vladislav Voronin
@vrnvorona

Hi. I have weird problem with Safari. It won't click, or will click only once and then will throw TimeoutException. Chrome/Firefox is perfect.

Nothing? :(

Andrei Solntsev
@asolntsev
@vrnvorona we haven't enough information to help you. There might be many reasons.
Vladislav Voronin
@vrnvorona
Alright, what kinda of info do i need to provide?
Andrei Solntsev
@asolntsev
Wait, I believe this question is not related to Selenide. It’s rather about Safari or Safaridriver.
Boris Osipov
@BorisOsipov
Yep as I know in some safari versions click doesn't work at all and workaround is click via actions
Sajan
@woodsongem
Hello All,
is it possible to take full page screenshot ?
Andrei Solntsev
@asolntsev
Ifaik "AShot" library can do it.
Sajan
@woodsongem
thanks a lot @asolntsev
Dai Pham Ngoc
@daipn-1859

@asolntsev Hello! I tried to pass basic authentication for my website on ie 11 with the code below

open(Configuration.baseUrl, "", "username", "password");

As the document guideline, the basic authen on ie should be supported, but I saw the action result on the screen.
We cannot input basic username/password and accept alert dialog on ie. Is this a bug from Selenide?
Thank you so much!

Andrei Solntsev
@asolntsev
I don't think it's a Selenide bug. Rather IE 11 doesn't support this feature.
1 reply
Andrei Solntsev
@asolntsev
I am not sure if there exists such a library.
I rather recommend to stop running tests in Internet Explorer. It's not supported anymore, even by Microsoft.
Dai Pham Ngoc
@daipn-1859
Yes. You're right and that makes sense. But my customer told me that 70% of the users of our product are using Internet Explorer.
This thing is very annoying to me :(
Thank you so much for your help!
Dai Pham Ngoc
@daipn-1859

@asolntsev Morning! If I want to set some preferences into firefox profile to disable "Download and open" dialog as

browser.helperApps.neverAsk.saveToDisk", "binary/octet-stream;...
browser.helperApps.neverAsk.openFile", "binary/octet-stream;...

How could I do it? Is there any way to add them into command lines as chromeoptions.args in Configuration?