I am using Firefox Selenium Web Driver to run automatic tests on a dedicated testing machine, so there is nobody pressing Shift there that would cause Firefox to start in the safe mode. But still several times a day Firefox starts with this safe mode dialog:
Any idea what could be causing this behavior?
Multiple tests are running at the same time, so there are several Firefox instances, can they maybe influence each other somehow?
I have disabled automatic safe mode after Firefox crashes as described here, but without success.
The reason is that some of my tests are running external AutoIt script that is "pressing" a Shift key to enter upper case letters. If another test is starting its Firefox at the same moment, Firefox detects the Shift key and displays the Safe Mode dialog.
osdHotkey simple utility that displays and logs pressed keys helped me to find out what is going on.
Related
I've got a Selenium test which crashes my browser (Firefox) whenever it runs. It's just a simple test (login, logout, login, logout, login ... crash) and I can't reproduce the crash when I do the same things manually, so I think the problem is with Selenium itself.
However, the issue could be that my Firefox starts with different options than when Selenium starts it. I could confirm that's not the case if I could start Firefox the exact same way Selenium starts it (eg. without plug-ins, with all history cleared, etc.) ... but I'm not sure how to do that.
Can anyone tell me which options to use to make Firefox run the same way as when Selenium runs it?
I was never able to find out how to emulate Selenium's use of Firefox. I tried using a fresh Firefox profile, but that still seemed to have differences from how Selenium ran Firefox.
Instead I wound up re-writing my test to be two tests, and then it was able to log in/out twice in the first test and once in the second test, avoiding the issue I was trying to debug (which only manifests when I try to log in/out 3 times in the same test).
If anyone can provide a better explanation of how to emulate Selenium's running of Firefox I'd be happy to accept that answer.
I have a proprietary application for automated testing that I built here at work that uses Selenium WebDriver classes to test our applications. It uses Firefox, but sometimes, when a new browser is launched, Firefox will open in Safe Mode and display the Safe Mode dialog. This seems to happen completely randomly, i.e. I will set up twenty tests to run and at any point this might happen. There only one block code that can be executed from test to test to launch a new browser, so it isn't in the testing application. Is there a way to override, or bypass, the safe mode dialog when this happens?
I need to run regressions overnight a lot of the time and it's frustrating when I see that my tests have been hung because of this
I am running Selenium Webdriver locally on my windows home server (windows 7 professional actually) which logs to a site and sends some emails. It's a java program with a single thread running.
I can see Firefox opening up just fine when running through Eclipse and follow the clicks etc as it logs on without problems.
I have set up a Task Scheduler task to start it up every morning though and run the jar. The program runs fine but when Firefox opens it is almost invisible, I can see the grey frames of it but everything else is transparent and invisible and if you drag something in front of it the graphics get stuck.
When clicking on Properties on Task manager I can see that it started with firefox.exe - foreground whereas when I open Firefox normally it says -browser.
The program still does what it should do, it's just Firefox is not visible at all when running through java -jar X.jar etc.
Any ideas why?
Windows 7 Professional
WebDriver 2.32
Firefox 21
I suspect it has something to do with the anonymous Firefox Profiles created each time firefox runs. I usually delete them from Temp once a week.
P.S No idea if it matters but server is headless and I am accessing it through TeamViewer.
Issue solved by deleting firefox profiles and loading from scratch. Weird, not sure yet what caused this and if it happens again.
Perhaps I will create a specific firefox profile and use instead of a anonymous one created each time.
I love firebug for helping debug my web apps, as well as seeing how others have implemented there sites. However firebug hinders memory leak testing.
I've just found that FireFox can be launched in safemode which disables all addons, which is great for memory usage testing however once firefix is launched (either samemode or not) all subsequent firefox launches (they all appear in task manager as 1 firefox instance) will use the mode of the first one.
I'd like to leave one in same mode testing some apps for leaks and use another with firebug to develop.
I've tried making a copy of the FireFix.exe and even copying the whole firefox directory but it still launches as one application.
I could always use VirtualBox to create a full virtual PC for this testing but that seams like a large overhead.
Edit
I have just tried the -no-remote switch but it just comes up with "firefox is already running .... you must first close the existing Firefox process.... "
First close all your Firefox instances. With all instances closed, run firefox via the "Run..." dialog on windows, typing "firefox -p". It will open with the profile manager, where you can create multiple profiles with different configurations.
After creating your profiles, just run you "main" browser using "firefox -p" and select your "main" profile. To open another instance using a different profile, run Firefox using "firefox -no-remote -p" and it will prompt the profile manager again, so you can choose a different profile.
I have a code, which captures a given window by PrintWindow function. Specifically I do capture web-pages in a browser. This code is tested in a standalone Windows application, and it works ok. The same code is incorporated into NPAPI plugin and loaded into Google Chrome. There problems happen. If Chrome has only one tab, the code works OK. If Chrome has 2 tabs, the code returns black box of expected size. I tested the standalone application and the plugin at the same moment, on the same window handle (Chrome_RenderWidgetHostHWND). Application does ALWAYS work, the plugin does ALWAYS fail if multiple tabs are open in the browser.
I'd really appreciate, if someone give a clue how to fix this.
Thanks in advance.
NB. Other methods of capturing windows are inapplicable due to even greater shortcomings for my usecase.
I bet you're running into sandboxing issues.
Your app is likely running at the "normal" integrity level, so it has no problem posting the WM_PRINT or WM_PRINTCLIENT message to the Chrome process. (PrintWindow uses these messages under the covers.)
When you're a plugin in Chrome, I believe your code runs as a "low" integrity process (which reduces the chances of things like shatter attacks). Thus it doesn't surprise me that sending the message to a window in another process fails.
Unfortunately, that doesn't explain why it works when Chrome has only one tab. Are you finding the same instance of Chrome_RenderWidgetHostHWND in both the app and the plugin in the case where you have multiple tabs open? In general, there's one of these windows per tab. How are you finding the window?