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

Error trying to run tests using Edge #284

Open
mickyJNST opened this issue Feb 5, 2022 · 13 comments
Open

Error trying to run tests using Edge #284

mickyJNST opened this issue Feb 5, 2022 · 13 comments

Comments

@mickyJNST
Copy link

Using v2.0.1, the following error is thrown when --capability browserName edge:

            elif browser == "EDGE":
>               key = edge_options.KEY
E               AttributeError: 'Options' object has no attribute 'KEY'

../python_venvs/default/lib/python3.9/site-packages/pytest_selenium/pytest_selenium.py:115: AttributeError

Here is a screenshot from debugger:

pytest_selenium_edge_error

@BeyondEvil
Copy link
Contributor

Would you mind sharing a little more information regarding your environment? OS, python and pytest versions etc?

If possible, we would truly appreciate a minimal reproducible example. Thanks 🙏

@mickyJNST
Copy link
Author

Sure thing @BeyondEvil - here you go:

os: macOS BigSur
python: 3.9.6
pytest: 6.2.2

One thing I noticed after revisiting this topic to write this response is that I had the selenium-3.141 package installed. After uninstalling this, and also uninstalling and reinstalling pytest-selenium, I see that selenium-4.1.3 is installed...and, I no longer get the original error I reported. However, my tests still don't run using Edge. There is no error now - pytest just runs without actually doing anything (and never actually finishes).

Note, I am using the selenium/standalone-edge Docker image from https://github.com/SeleniumHQ/docker-selenium and running tests with the following pytest parameters:

--driver Remote --selenium-host localhost --selenium-port 4444 --capability browserName edge

The same setup using Chrome and Firefox works fine. Unless something obvious jumps out to you given this new information, I will work on putting together a minimal reproducible example.

@BeyondEvil
Copy link
Contributor

Thanks for the extra info.

I've been away for a while, so I'm not in the loop wrt. Selenium 4, so unfortunately nothing obvious jumps out. :(

@BeyondEvil
Copy link
Contributor

pytest-selenium v4 was just released. Can you check and see if this issue is still relevant? @mickyJNST

@mickyJNST
Copy link
Author

Hey @BeyondEvil - I am still running into the same issue. I created this simple example that demonstrates the problem. I granted you access and the README hopefully has enough info to reproduce the issue. Let me know if you need more info.

@BeyondEvil
Copy link
Contributor

Hey @BeyondEvil - I am still running into the same issue. I created this simple example that demonstrates the problem. I granted you access and the README hopefully has enough info to reproduce the issue. Let me know if you need more info.

Appreciate it! Will take look during my day. 👍

@BeyondEvil
Copy link
Contributor

Things Are Never Easy ™️

I happen to run an M1 MacBook (Apple Silicon) and the regular docker images doesn't support that.

They have experimental support in something called Seleniarm (which I've actually used).

However, they don't have prebuilt images for Edge 😏

So it's going to take a little bit of extra work unfortunately.

@BeyondEvil
Copy link
Contributor

Sorry, I've spent 2 hours trying to get mainly the seleniarm Edge image building and running properly on my machine now - without any luck.

Not sure what my next move is.

@micky1uphealth
Copy link

Ugh - that sucks. The one thought I had was to run Selenium "the old fashioned way" i.e. run Selenium \ Edge directly on machine, outside of Docker. If the original problem is reproducible using this setup then good - will allow for further debugging of the original issue. If not, then at least it narrows down the source of the issue. I can give this a shot some time today \ this weekend if I get a chance.

@BeyondEvil
Copy link
Contributor

BeyondEvil commented Sep 30, 2022

I have a Mac Mini at home, I can see if I can spin this up on that (it's an intel machine) during the weekend too.

Whoever gets to it first can report back @micky1uphealth

@BeyondEvil
Copy link
Contributor

Sorry man, my mac mini is too old (2011) which means it's stuck on High Sierra, which means Docker doesn't support it any longer, which means I can't run docker-compose above Version: 2...

@BeyondEvil
Copy link
Contributor

BeyondEvil commented Sep 30, 2022

So, I managed to get the images running on one of my NAS' 😂

I took a step back and tested this with pure selenium (w/o the pytest-selenium plugin) and I had the same issue you described.

Anyway, after reading this: https://www.selenium.dev/documentation/webdriver/browsers/edge/

And adjusting accordingly, it's now working. 😊

I'm probably going to fix this and re-release 4.0.0.

@BeyondEvil
Copy link
Contributor

Shit. This is gonna take some effort. It's going to require quite some effort to fix this properly.

I can't see an easy fix unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants