Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • Sep 17 20:38
    asolntsev assigned #1565
  • Sep 17 20:38
    asolntsev opened #1565
  • Sep 17 20:37

    asolntsev on undeprecated-get-self

    #1560 un-deprecate method Eleme… (compare)

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
Screenshot from 2021-06-18 13-57-29.png
Andrei Solntsev
@asolntsev
@daipn-1859 ok, we just need to add binary/octet-stream? It's easy.
Dai Pham Ngoc
@daipn-1859
@asolntsev Yes. I hope it works!
Andrei Solntsev
@asolntsev
@daipn-1859 Please try Selenide 5.22.1 with binary/octet-stream added (should appear in maven central in few minutes).
Dai Pham Ngoc
@daipn-1859
Thank you. I'll try it later asap when the maven central is ready
Andrei Solntsev
@asolntsev
It’s already in maven central.
2 replies
John Robinson
@torrlane
Hi, I'm trying to use the uploadFromClasspath method to upload a document. However, it's failing and I think that the issue is that the document is inside a jar file. Is this a supported usecase for Selenide?
Here's the error:
ERROR!
java.lang.IllegalArgumentException: URI is not hierarchical
at java.base/java.io.File.<init>(File.java:420)
at com.codeborne.selenide.commands.UploadFileFromClasspath.findFileInClasspath(UploadFileFromClasspath.java:44)
at com.codeborne.selenide.commands.UploadFileFromClasspath.execute(UploadFileFromClasspath.java:30)
at com.codeborne.selenide.commands.UploadFileFromClasspath.execute(UploadFileFromClasspath.java:19)
at com.codeborne.selenide.commands.Commands.execute(Commands.java:155)
at com.codeborne.selenide.impl.SelenideElementProxy.dispatchAndRetry(SelenideElementProxy.java:128)
at com.codeborne.selenide.impl.SelenideElementProxy.invoke(SelenideElementProxy.java:80)
at com.sun.proxy.$Proxy455.uploadFromClasspath(Unknown Source)
John Robinson
@torrlane
I've raised issue selenide/selenide#1493 for this. I hope that that's ok
Andrei Solntsev
@asolntsev
@torrlane Yes, sure, it’s absolutely ok. :)
It’s even better if you provide a pull request ;)
By the way, why do you need to use a file from jar? Don’t you have tests in src/test/java and resources (including files to be uploaded) in src/test/resources?
John Robinson
@torrlane
Thankyou for getting back to me Andrei - and making me think a bit deeper about the issue. In case anyone else is following this discussion, it's now moved to the ticket - selenide/selenide#1493
Sajan
@woodsongem
Hello All,
is it possible to pass custom video filename during savevideo? Currently I am getting the format below : PASSED-Test-20210629-171748.mp4. it would be nice to save on custom name
Andrei Solntsev
@asolntsev
Hi @woodsongem !
  1. Are you sure you are talking about Selenide? Selenide doesn’t save any videos.
  2. Why do you want to customize the file name? Usually it’s not needed, and there is probably a better solution for your problem.
5 replies
Andrei Solntsev
@asolntsev
Just change the order: first enable the proxy, then open the browser
Sajan
@woodsongem
thanks @asolntsev for your response . now getting below error and trying to fix it
ERROR loading 'java.lang.IllegalStateException: config.proxyEnabled == true but proxy server is not created. You need to call `setWebDriver(webDriver, selenideProxy)` instead of `setWebDriver(webDriver)` if you need to use proxy.'
java.lang.IllegalStateException: config.proxyEnabled == true but proxy server is not created. You need to call `setWebDriver(webDriver, selenideProxy)` instead of `setWebDriver(webDriver)` if you need to use proxy.
Sajan
@woodsongem
sample 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(videoFileLocation),
                                VncRecordingContainer.VncRecordingFormat.MP4)
                        .withCapabilities(DesiredCapabilities.chrome())
                        .withCapabilities(chromeOptions);
                      chrome.start();

 RemoteWebDriver driver = chrome.getWebDriver();
            chrome.getWebDriver().setFileDetector(new LocalFileDetector());
            WebDriverRunner.setWebDriver(driver);
if (!Configuration.proxyEnabled) {
                ScheduleModel scheduleModel = canaExecutorDetail.getScheduleDetail().getScheduleModels().get(0);
                    //Method WebDriverRunner.getSelenideProxy() returns null when called before method open().
                    // It's because method open() actually starts proxy server and opens a browser window.
                    Configuration.proxyEnabled = true;
                    Configuration.fileDownload = PROXY;
                    open();
                    //Now you need to say the proxy to start tracking requests:
                    BrowserUpProxy browserUpProxy = WebDriverRunner.getSelenideProxy().getProxy();
                    // remember body of requests (body is not stored by default because it can be large)
                    browserUpProxy.setHarCaptureTypes(CaptureType.getAllContentCaptureTypes());
                    // remember both requests and responses
                    browserUpProxy.enableHarCaptureTypes(CaptureType.REQUEST_CONTENT, CaptureType.RESPONSE_CONTENT);
                    // start recording!
                    browserUpProxy.newHar("pofig");
            }
Andrei Solntsev
@asolntsev
No. It doesn't work that way.
Selenide proxy is only started if Selenide opens the browser.
In your case, you open the browser (using testcontainers). Then you need to start your own proxy and add its address to Chrome options.
Andrei Solntsev
@asolntsev

Released Selenide 5.22.3:
Fresh and delicious bugfixes

https://selenide.org/2021/07/05/selenide-5.22.3/

Arsen Papoyan
@arsen.papoyan:matrix.org
[m]
Hi @asolntsev.
Selenium has this Actions class:
actions.dragAndDropBy(WebElement source, int xOffset, int yOffset)
How can I use an action like this in Selenide?
That is, drag and drop elements with coordinates.
Andrei Solntsev
@asolntsev

@arsen.papoyan:matrix.org There is a method for D’n’D in Selenide:

$("#drag1").dragAndDropTo("#div2");
$("#drag1").dragAndDropTo("#div2", usingActions());            // uses Selenium Actions
$("#drag1").dragAndDropTo("#div2", usingJavaScript());     // uses JS, seems to work much better

though, none of them support D’n’D wuth an offset.

@arsen.papoyan:matrix.org If you really need offset, you can still use selenium Actions:
Selenide.Actions().dragAndDropBy(from, offsetx, offsety).perform();
Sajan
@woodsongem
thanks @asolntsev for your response on the proxy. now I am able to enable proxy and getting HAR data.
during analysis on request found couple of request like update.googleapis.com/service/update2/json, sync-tm.everesttech.net/upi/pid/r7ifn0SL
which is not generate request by our application. any idea how to stop those request ?
Andrei Solntsev
@asolntsev
@woodsongem I think these requests are generated by the browser itself. No, I don’t know how to avoid them, but can’t you just ignore them? :)
Sajan
@woodsongem
thanks @asolntsev for your response. I am preparing a custom report using HAR data.. will add custom code to skip those requests. thank you @asolntsev
Sajan
@woodsongem
Hello @asolntsev ,
selenide will run in parallel with the test container if yes? any changes need to make
thanks @asolntsev
Andrei Solntsev
@asolntsev
@woodsongem
  1. Yes, Selenide can run tests in parallel. No changes needed.
  2. Do you mean https://www.testcontainers.org/ library ?
Then there are some working examples on github: https://github.com/selenide-examples/testcontainers
Sajan
@woodsongem
yeah thanks @asolntsev for your response.
Sajan
@woodsongem
Hello All,
How to capture javascript errors using selenide. I found the reference below. I would like to capture only Javascript errors. Which log level will be suitable for this instead of Level.ALL)?
https://selenide.org/2019/12/16/advent-calendar-browser-logs/
Andrei Solntsev
@asolntsev
I don't know exactly. Can't you just try all levels?
Sajan
@woodsongem
Thanks for your response @asolntsev . I can do that. How can I filter only errors from all levels ? because I didn't see any log level is error.
Andrei Solntsev
@asolntsev
Still, I don't know exactly. Can't you just try all levels?
Andrei Solntsev
@asolntsev

Released Selenide 5.23.0: "New generation checks”

https://selenide.org/2021/07/16/selenide-5.23.0/

Sajan
@woodsongem
yeah sure thanks
Konstantins
@ktarasjuks

[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 90.826 s - in runners.PaymentsRunner
why doesnt count as passed or failed? using selenide allure for reports and after this the allure reports are empty..
to launch tests using standard mvn clean test command
SelenideLogger.addListener("AllureSelenide", new AllureSelenide().screenshots(true).savePageSource(false));
is in before steps...
POM build steps:
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<configuration>
<filesets>
<fileset>
<directory>test-output</directory>
<includes>
<include>/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<includes>
<include>
/Runner.java</include>
</includes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>

all others sample project works fine.. what i am doing wrong :(

Cucumber+ junit4 + selenide + allure