I am using Firefox Developer Edition 49.0a2 and I am able to open the web browser but after driver.get("example.website.com") executes, it just loads the page and hangs there. The test does not fail or error out.
I've tried using Marionette Driver and it doesn't even interact with the browser. I have also tried the different variations of the constructor such as FirefoxDriver(FFbinary, FFprofile, FFcapabilities) and the others that only require one or two of the parameters in all possible permutations. The developer edition of Firefox is where I get the best results as Firefox 47.0 is explicitly not supported.
i face the same issue so i tried to update the Windows OS and checked again
it worked fine for me.
Gecko driver might not be compatible if we do not update OS as well
Check it once if it help
Related
I have a selenium java project but I have an unsual error after some weeks not working on the project.
After searching on internet, most people said it was related to the chrome driver version. This seems weid, because I use the "io.github.bonigarcia.wdm.WebDriverManager" package to handle chrome version (and as you can see, I used the 103 chrome driver version).
After downloading the next version, and use:
"System.setProperty("webdriver.chrome.driver", "C:\Users\path\webdriver\chromedriver-104.exe");" the browser even fail to open, and it print me this error message.
But it seems the version is still 103 for my "personnal" chrome browser. I tried to update it, but it remains 103..
I tried to download the 104, but it act "beta chrome"...
What am I supposed to? Is there anyone else having issue with chrome selenium lately? Is there a work around? Can someone explain why selenium even bother to know the version of my work chrome?
The bug is actually in version 103 of the Chrome browser, not chromedriver. See https://bugs.chromium.org/p/chromedriver/issues/detail?id=4121 .
I have been able to mostly work around this by adding Thread.Sleep()'s (in C#) ranging from a fraction of a second to a few seconds, before the Selenium calls which fail.
One of the ways WebDriver identifies itself as a bot to external websites is by setting the webdriver-active flag to true.
A user on SO suggested that it is possible modify Chrome Driver source code to remove all bot-identifying attributes (see this and this response).
Is it possible to achieve a similar outcome w/ Firefox by modifying the source code of Geckodriver, Firefox WebDriver or perhaps both? I'm asking because there is currently no way to conceal WebDriver using Firefox Options without source code modification.
If we can somehow remove bot identifying features from the source code, we can prevent WebDriver from being identified as a bot without needing to bundle TOR with Firefox.
While there's no getting around the fact that Selenium (in its present state) identifies itself, surely we can modify source code to remove all identification similar to how it's achieved in Chrome Driver?
In the discussion Can a website detect when you are using Selenium with chromedriver? as suggested by different users to open the ChromeDriver in a Hex Editor and edit the document variables replacing the cdc_ and $wdc_ string might be possible, but achiving the same with GeckoDriver may not be possible.
Moreover, the commands like execute_cdp_cmd() and Python libraries like selenium-stealth may not be currently supported by GeckoDriver.
The GeckoDriver source code can be easily downloaded from mozilla / geckodriver page both in zip and tar.gz format. If you are on windows system you can unzip the downloaded file and find the the source code of different modules in the ...\geckodriver-0.30.0\src directory:
Additionally, geckodriver is made available under the Mozilla Public License. GeckoDriver source code can also be found in mozilla-central under testing/geckodriver.
WebDriver Specifications
Now as per WebDriver W3C Editor's Draft:
The webdriver-active flag is set to true when the user agent is under remote control. It is initially false.
So there can be two possible ways to keep webdriver flag as false as:
Remove the readonly attribute, so can be edited runtime. (as discussed in this answer)
Strangle the WebDriver from emitting the signals that the user agent is under remote control.
To me the second option looks pretty much viable as the most frequently updated tier is the second tier (Selenium WebDriver.dll and WebDriver.Support.dll modules). Since App Studio uses C# and .Net version 4.0 (before Selenium 4.1.0 (November 22, 2021)) to communicate with Selenium, you need to download the .Net 4.0 version of the Selenium modules. The current stable version being 4.1.0. Once the zip file is downloaded, extract the content to a folder and navigate to the net40 subfolder.
Now, you can copy the WebDriver.dll and WebDriver.Support.dll files to the bin folder of the App Studio installation. e.g, C:\ibi\AppStudio82\bin and make the required changes.
As an alternative, you can also download the NuGet, copy the .Net 4.0 content of the NuGet package into the bin folder of the App Studio installation and make the required changes.
tl; dr
Building geckodriver
Testing geckodriver
Getting following error in selenium tests
POST /session/ee1b9201-dadc-7446-b753-0a418a230d30/moveto did not match a known command
What i've done is
Actions resetView = new Actions(driver);
resetView.moveToElement(el).perform();
Environment:
Firefox v47.0
Webdriver 3.0.0-beta2
This is entirely expected. No releases of GeckoDriver (Marionette) support the Actions class. It is one of the top priorities of Mozilla's team developing Marionette.
There is an issue that Selenium tracks, that is blocked by the Marionette issue.
Since the issue it's over 3 weeks old, and looking at their commit log, I wouldn't hold my breath for a patch anytime soon.
If you can use Firefox 47.0.1, because in Firefox 47.0 they had another bug, you can use the old WebDriver API that works (not Marionette). From 48 it stopped working, because you're supposed to use Marionette. Yes, that Marionette that is not finished.
If you must test on Firefox, I recommend you should stick to Firefox 47.0.1, Selenium 2.latest, eventually throw them in a docker image, and run like that.
That's what I do at least for Germanium, until it will hopefully eventually work also for Marionette.
I've got a little test suite working on my laptop which I've tried to transfer over to my work desktop. To, hopefully, make things easier, I used the same version of Java and maven. However, typically, it's not been so easy :)
When I started Firefox, I got a "Firefox has stopped working" message box. The message box indicated the issue lay with "xul.dll" - so I closed the box and Firefox opened. It does this everytime I open Firefox.
I have even stripped out all my allure and other code and just ran a simple case:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.co.uk");
However this doesn't work either.
It was then I checked the versions of Firefox were the same, turns out they weren't - but the Firefox updated fixed that. But my test still passes on the laptop, but fails on the desktop. I can't see anything I have missed, I can see one possible issue - the work desktop has Kaspersky installed.
Has anyone ever experienced what I've described?
I have also observed that antivirus causes the Firefox to hang during the launch. Try disabling the antivirus and rerun your script to verify that in your case also the antivirus/firewall is causing the issue.
Check the version of Firefox on both computers. I have two Windows machines with Selenium 2.45.0. One machine has Firefox 37.0.2 and the code below executes fine. The other machine I just updated to Firefox 38.0.1 and I receive that error message box.
#Test
public void testFirefoxDriver() throws Throwable
{
new FirefoxDriver();
}
I've been using Selenium for over a year now. Our production server automatically updates Firefox and this occasionally causes incompatibilities between Firefox and Selenium. I would expect to see a new Selenium release very soon.
Firefox 38.x is not supported by Selenium 2.45.1. Either you have to roll back your firefox to 37.x or wait until next revision of Selenium.
https://github.com/SeleniumHQ/selenium/issues/437
I've got this same issue. Funnily enough it was working yesterday morning I started getting it yesterday afternoon and now it appears to be messing up my tests.
I have Selenium 2.45.0 & Firefox 38.0.1.
My tests were running perfectly before this started happening and nothing has changed in my code. I've also ran another test suite just to make sure that it wasn't the one I was working on. The same thing happened.
I've just uninstalled firefox downloaded the previous version and they now work again with no crash.
Earlier I was using chrome 32, which was very fast. But after upgrading to 36, it is very slow. It is taking more than a second to execute sendKeys instruction even after location element.
Any help would be appreciated.
The answer can be the following if you use 64-bit OS architecture on your PC - as far as I remember is because Selenium performs switching between 32-bit and 64-bit mode (which is very slow operation). ChromeDriver was supported only in 32-bit. I had same issues with IE driver too.
Update:
Next thing to check then is that the proxy and network settings in chrome have not been altered. In the begging I considered extensions and add-ons, but Selenium raises clean instance each time. As to #36 being slow - check the dev threads on google chrome, you will see the issue has been ongoing for well over 6mths and is affecting cross-platforms too. And one solution is try disabling hardware acceleration.... it was a tenfold improvement for me on my laptop.
To disable it... type "chrome:settings" in the address bar, click Advanced Settings, then uncheck "Use hardware acceleration when available" under the System header. Close all open Chrome browser instances and restart Chrome.