hey travis users,
i’ll try to use the non-dev versions in the build server if it were possible, but as far as I tell, version 91 is the earliest edge and msedgedriver
compatible with any version of linux.
here are some error I get:
from msedge.selenium_tools import EdgeOptions
from msedge.selenium_tools import webdriver as EdgeDriver
edge_options = EdgeOptions()
edge_options.use_chromium = True
driver = EdgeDriver.WebDriver(options=edge_options)
from that I get this:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: No matching capabilities found
my understanding that this error happens when msedgedriver
is not in the executable path. In Travis CI, I have the dev version of msedgedriver
is executable with chmod, which is another reason why I’m thinking the problem is because I’m using the edge/dev versions
relevant part of my .travis.yml
file:
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
- sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
- sudo rm microsoft.gpg
- sudo apt update
- sudo apt install microsoft-edge-dev
Hey @SolarUltima,
Try the following code to see if it runs on Linux, use chmod u+x
so you have proper permissions. Please also note to change the paths
in the snippet to your own paths
:
from msedge.selenium_tools import EdgeOptions, Edge
options = EdgeOptions()
options.use_chromium = True
options.binary_location = r"/usr/bin/microsoft-edge-dev"
options.set_capability("platform", "LINUX")
webdriver_path = r"/your_path/msedgewebdriver" # Make sure it's your path
browser = Edge(options=options, executable_path=webdriver_path)
browser.get("https://www.google.com")
More information: Python Selenium Settings On Microsoft Edge Dev On Linux.
Your .travis.yml
file looks fine, I’m guessing that’s not the entirety of it – but from what I’m reading of it, there’s no issues. If you want to add something like Django, you can do:
assert "Django" in browser.title
So it would then look like:
from msedge.selenium_tools import EdgeOptions, Edge
options = EdgeOptions()
options.use_chromium = True
options.binary_location = r"/usr/bin/microsoft-edge-dev"
options.set_capability("platform", "LINUX")
webdriver_path = r"/your_path/msedgewebdriver" # Make sure it's your path
browser = Edge(options=options, executable_path=webdriver_path)
browser.get("https://www.google.com")
assert "Django" in browser.title
Happy building!
Montana Mendy
1 Like
adding
webdriver_path = r"/your_path/msedgewebdriver"
did the trick, thank you @Montana!!!
@SolarUltima,
Glad I could help you out.
Happy building!
Montana Mendy
1 Like