Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:11
    Jaaap commented #1559
  • 16:10
    asolntsev labeled #1556
  • 16:10
    asolntsev labeled #1556
  • 16:10
    asolntsev labeled #1556
  • 16:09
    asolntsev commented #1556
  • 16:08
    asolntsev commented #1533
  • 16:04
    asolntsev labeled #1560
  • 16:04
    asolntsev labeled #1560
  • 16:04
    asolntsev labeled #1560
  • 16:04
    asolntsev milestoned #1564
  • 16:04
    asolntsev labeled #1564
  • 16:04
    asolntsev labeled #1564
  • 16:03
    asolntsev assigned #1564
  • 16:03
    asolntsev opened #1564
  • 16:03

    asolntsev on improve-page-objects

    #1560 make it optional to exten… #1560 un-deprecate method Eleme… (compare)

  • 15:32
    asolntsev labeled #1559
  • 15:31
    asolntsev commented #1559
  • 15:24
    asolntsev closed #1562
  • 15:24
    asolntsev labeled #1562
  • 15:24
    asolntsev assigned #1562
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

package runners;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty",
"html:target/cucumber/cucumber-html-report",
"junit:target/cucumber/cucumber-junit-report.xml",
"json:target/cucumber/cucumber.json"},
tags = "@SmokeTests",
features = {"src/test/resources/features"},
glue = {"steps"}
)
public class PaymentsRunner {
}

Andrei Solntsev
@asolntsev
This question is not related to Selenide. It’s rather about Cucumber or Allure.
Sajan
@woodsongem

Hello @asolntsev ,
I am getting below error while select value in dropdown. Any idea?
Error: Cannot locate option with value: Test
Code:selenideElement.selectOptionByValue("Test")

TIA

Sajan
@woodsongem

in chrome browser HTML code:

<option label="Test" value="string:Test">Test</option>

Selenide code: this.element.findElements(By.xpath(".//option[@value = " + Quotes.escape(value) + "]")

not sure why angular is adding string in front of the value.

Andrei Solntsev
@asolntsev
That’s the point: its value is string:Test, not Test.
Try using selenideElement.selectOption("Test”) instead. It will find option by text, not by value.
Sajan
@woodsongem
thanks @asolntsev for your response. we don't want to check text because it keeps on changing text, not value.
we bind only a value called "Test" not "string:Test". might be I have to loop through options to get an index and select proper index.
Andrei Solntsev
@asolntsev
I don’t understand. When you loop through options, how do you find the right option? You still need to check its text or value. You will get the same problem.
Devon Jones
@devmjones
How do I integrate Selenide/TestNg with Saucelabs? I see a ton of Sauce related Maven dependencies for Saucelabs, but I can't find any example project that shows how the logic to run locally vs via Saucelabs is implemented. Do the config options go in the pom.xml? A config file?
Andrei Solntsev
@asolntsev
damu
@zmmx011

Hi. selenide download to random path selenide/selenide#1220

<timestamp><pid><thread_id> how do I disable this feature?

Andrei Solntsev
@asolntsev
@zmmx011 this is a common question :)
Most probably you don't need to disable this feature. You shouldn't really care about the downloads folder because method $.download() returns the File instance - just use it. No need to search the file.
damu
@zmmx011
@asolntsev $.download() is element have href attribute.. but in my case download element haven't href attribute, so i used $.click(). problem is I want to scan the downloaded file but I don't know the path
Andrei Solntsev
@asolntsev
@zmmx011 try setting Configuration.fileDownload = FOLDER - then method "$.download will not require href anymore.
Andrei Solntsev
@asolntsev

Good evening!

We released a small update Selenide 5.23.3 with a fix for downloading "potentially harmful" files in Chrome (like .exe and .dmg files).

https://github.com/selenide/selenide/releases/tag/v5.23.3

Saikat Sengupta
@s4ik4t

Trying to explore Selenide 6 beta with Selenium 4 however for some weird reason the dependency tree is looking like this:

[INFO] +- com.codeborne:selenide:jar:6.0.0-beta-1-SNAPSHOT:test
[INFO] |  +- org.seleniumhq.selenium:selenium-java:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-api:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-edge-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-opera-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-remote-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:3.141.59:test
[INFO] |  |  +- org.seleniumhq.selenium:selenium-support:jar:3.141.59:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.22:test
[INFO] |  |  +- org.apache.commons:commons-exec:jar:1.3:test
[INFO] |  |  +- com.squareup.okhttp3:okhttp:jar:3.14.9:test
[INFO] |  |  \- com.squareup.okio:okio:jar:1.14.0:test

Why on earth Selenium 3 is loaded here?

Andrei Solntsev
@asolntsev
I see another tree in my test project.

Did you add these lines to your build.gradle?

configurations.all {
  resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

(it says Gradle to always fetch the latest snapshot dependency)

3 replies
Andrei Solntsev
@asolntsev

Released Selenide 5.24.0:

Judgement day!

https://selenide.org/2021/08/29/selenide-5.24.0/

Leonidas Mitrou
@lemitrou
Hi there
i start migrate some test from pure selenium to selenide
and i get Sizzle is not defined , in some test and runs
any idea?