Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:22
    ervuks commented #1578
  • 06:20
    asolntsev closed #1313
  • 06:20
    asolntsev commented #1313
  • 06:18
    asolntsev synchronize #1566
  • 06:18

    asolntsev on fokinp-refactor_text_conditions

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

  • 06:10
    adrien1212 commented #1574
  • 06:09
    adrien1212 commented #1574
  • 05:55

    asolntsev on gradle

    (compare)

  • 05:55
    dependabot[bot] commented #1568
  • 05:55
    asolntsev closed #1568
  • 05:55
    asolntsev commented #1568
  • 05:54
    asolntsev synchronize #1576
  • 05:54

    asolntsev on fix-element-screenshot-on-mac

    #1571 don't change sizes of oth… #1571 try to make test more rea… (compare)

  • 05:36
    asolntsev edited #1577
  • 05:34
    asolntsev converted_to_draft #1578
  • 05:34
    asolntsev assigned #1578
  • 05:34
    asolntsev opened #1578
  • 05:34

    asolntsev on drag-and-drop-between-frames

    #1577 add code to reproduce the… (compare)

  • 05:29
    asolntsev labeled #1577
  • 05:29
    asolntsev edited #1577
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?

By default, I don't see browser.helperApps.neverAsk.openFile preference in selenide code setupDownload...
Andrei Solntsev
@asolntsev
Hi @daipn-1859 !
Currently Selenide sets browser.helperApps.neverAsk.saveToDisk preference when creating FF webdriver.
I thought it should be enough to silently download any files without a dialog.
Dai Pham Ngoc
@daipn-1859

@asolntsev But the popular content types in property file does not contain binary/octet-stream. Otherwise, I'm using selenide 5.22.0 and run FF 89 to download as

$(".download-button").download(DownloadOptions.using(FileDownloadMode.FOLDER))

The open dialog is displayed after running the command above. That requires to select Save File > OK on dialog to complete the download process. Did I do wrong for anything? :(

Dai Pham Ngoc
@daipn-1859
Oh. binary/octet-stream is defined as application/octet-stream.
I think the problem come from the missing of browser.helperApps.neverAsk.openFile