Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO SSL, slow driver execution #294

Closed
vrapsa opened this issue Nov 2, 2022 · 8 comments
Closed

NO SSL, slow driver execution #294

vrapsa opened this issue Nov 2, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@vrapsa
Copy link

vrapsa commented Nov 2, 2022

Hey! First of all wanna say thanks for this awesome framework looks like Selenide on Java!
My issue is that when i use my test_method(py) my test is actually super slow, but my internet connection is good. I find one possible issue like i see no SSL cert while executing tests. Might be reason here im not sure.
My project is fully clear: install selenium, pytest and pylenium, nothing more. Used guidline pylenium getting started aswell.
There is no SSL cert any site, even on qap.dev while executing.

@ElSnoMan
Copy link
Owner

ElSnoMan commented Nov 2, 2022 via email

@vrapsa
Copy link
Author

vrapsa commented Nov 2, 2022

def test_try(py):
py.visit("https://www.dns-shop.ru/")
py.getx("//a[@Class='ui-link menu-desktop__root-title' and text()='Компьютеры']").click()

17 seconds to pass the test with Pylenium, but if i go to my chrome locally to check loading speed its highly fast with SSL.

image

@vrapsa
Copy link
Author

vrapsa commented Nov 2, 2022

image

the same with qap.dev

@ElSnoMan
Copy link
Owner

ElSnoMan commented Nov 2, 2022

I run multiple tests against multiple websites and I get the same results. Check this out:

image

Observe that the Russian website is extremely slow to load even though there are only two steps in the test. The tests against other websites, SauceDemo in this screenshot, are much faster and have many steps.

Now, diving into the steps of the Russian test, observe that all of the Selenium/Pylenium steps are fast. So almost all the time is taken in the two steps to navigate to the website, wait for it to load, and then to click an element:

image

@ElSnoMan
Copy link
Owner

ElSnoMan commented Nov 2, 2022

As for the Not Secure issue, Pylenium uses WebDriverManager to build drivers, but any local Chrome or Firefox driver uses SeleniumWire. It looks like SeleniumWire's latest update is not coming with the driver's certificate installed. With some searching, I found a few things that can help:

Edit: I've tried all sorts of driver options and capabilities and they seem to have no effect. This should only affect local drivers, but the issue is kind of annoying. I tried things like:

- "allow-insecure-localhost",
- "allow-running-insecure-content",
- "ignore-certificate-errors",
- "unsafely-treat-insecure-origin-as-secure"

@marksmayo
Copy link
Contributor

I've run into this now as well, running it, and the screen is full of the certificate issues. Has Seleniumwire changed what they do, or is this something else?

@ElSnoMan
Copy link
Owner

ElSnoMan commented Jun 14, 2023

I'm also experiencing some slowness and cert issues. I'll take a look and see if it's SeleniumWire. If so, which it seems to be, then I'll add a flag to use Selenium or SeleniumWire.

Edit: It's definitely SeleniumWire. I'll be adding a new PyleniumConfig flag so users can enable SeleniumWire if they want, but it'll be set to false by default. It'll look like this:

{
  "driver": {
    ...
    "seleniumwire_enabled": false,
  }
}

@ElSnoMan ElSnoMan added the bug Something isn't working label Jun 14, 2023
@ElSnoMan ElSnoMan self-assigned this Jun 14, 2023
@ElSnoMan
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants