selenium server launching two test execution tabs in firefox - java

So as the title suggests, when launching my HTML suite with a custom firefox profile (also with multiwindow), the server is launching two tabs, both trying to execute the test, targetting the same single window the actions are being carried out in. If I close one of the selenium tabs, the test will then complete successfully.
The custom profile is a profile created in firefox 19.0.2 and I am now running it in 20.0
Now If I update up the custom profile to coincide with the latest version of firefox, this fixes the tab issue when launching the test...however my question is....
Does anybody know the cause of this behaviour?
Many thanks,
Joe

I think Firefox opens the second tab because the current milestone of the browser software does not match the value of the setting browser.startup.homepage_override.mstone in prefs.js: The browser tries to show sort of a successful-update-page in a new tab.
According to https://bugzilla.mozilla.org/show_bug.cgi?id=102313
you can suppress this behaviour by manually setting browser.startup.homepage_override.mstone to ignore. For me, this single change in prefs.js did the trick.
halfbit

Related

geock driver not responding

hi guys I wrote a software that needs to be permanently entered into a website and then perform a browser operation then close and open it again, and each time it opens, the browser profile changes ... but usually after 10 attempts, it seems that the Internet is cut off and the website dont open, but if I create a new tab myself, I can go to the same address manually ... Why does this happen ??... I use Firefox and geockdriver and of course selenium libraries
i created multiple Geockdriver.exe and tried to use each for one profile and also i set port for driver with profile.setPreference(FirefoxProfile.PORT_PREFERENCE, 65535); but still same problem happend
by the way i code in java
selenium-firefox-driver 4.1.3
firefox version 98.0.2

Java Applets and Firefox unresponsive Error message

I have a Java Applet. On IE, it works fine, On Firefox, Firefox frequently given a dialog box saying "The plugin is unresponsive/hung. Do you want to continue waiting for it or kill it?".
In order to troubleshoot, it would be useful to know how firefox detects that the plugin is unresponsive - has Firefox published this info anywhere?
I found this page - https://developer.mozilla.org/en-US/Add-ons/Plugins/Out_of_process_plugins/The_plugin_hang_detector
However this talks about killing the plugin & not giving this error message.
Following are additional measures you can take to resolve Unresponsive Script error.
Waiting longer for the error to resolve itself automatically
Blocking the offending script
Yanking the guilty add-ons
Disabling the hardware acceleration tool.
With one of these few steps, you won’t have to worry about the
Unresponsive Script error, can continue enjoying your browsing
activities on Firefox.
Fix Unresponsive Script Error in Firefox are briefly described below:
Change Script Runtime Value
In the Firefox configurations you’ll get the script runtime value. You’ll need to modify the default value and change it to “20”.
Open Mozilla Firefox.
Type “about:config” in the Address Bar.
Press ENTER.
A warning message will appear. Click “I’ll be careful, I promise!”
link to continue.
Double click a string named “dom.max_script_run_time”.
Replace its value with “20” and press ENTER.
Note: In case the problem still persists you can restore the default value by right clicking the string, selecting “Reset” option.
Use YesScript Plug-In
Install YesScript.
Close and re-load Mozilla Firefox.
Click the Tools menu, select Add-Ons.
Select “YesScript” and click Options.
A new dialog will appear. Enter the website URL which displays you
script error.
Click Add button. This will fix Unresponsive Script Error in
Firefox, Chrome & IE.
Start Firefox in the Safe Mode
In the safe mode a browser is loaded without loading any add-ons. Start the browser in safe mode to resolve faulty add-ons.
Click the Firefox button.
Click Help | Restart with add-ons disabled.
Alternatively, you may press Shift key while starting Firefox.
Disable Hardware Acceleration
Some computers may not support hardware acceleration of the browser. Disable this feature to fix Unresponsive Script Error in Firefox, Chrome & IE.
Click the Firefox button, select Options.
Click Advanced tab.
Uncheck the box “Use hardware acceleration when available”.
Close and re-open the browser.
Restore Default Theme
You might have to restore the default theme. Some of the features of existing theme are not supporting.
Click Firefox button, select Add-Ons.
Click Appearance tab on the left.
Set your default theme.
Disable Synchronization in Firefox
Do not let firefox synchronize items such as apps, settings, tabs, history, passwords, etc Disable the synchronization feature.
Click Firefox button.
Select Options.
Click the Sync tab.
Disable the synchronization feature.
Resource Link:
How to Stop Script Errors on Firefox

Execute Selenium Commands on a Browser that is already open

I am looking for an example code that will allow me to run Selenium commands against a browser that is already open.
Typically when you start testing with Selenium it opens a new instance of the browser. But I am looking
for a solution where you would run the script and it will just start executing its codes on whatever browser and tab is currently visible.
Is that possible?
As per my knowledge this is not possible with selenium.
You have to open browser during the test script only otherwise it won't be able to identify or capture already opened browser's object.
No its not. There is an old issue still open since 2009.

Automation server can't create object - Microsoft JScript runtime error

I am trying to run a Java webstart application which is launched from a html page. While loading I get an alert with the message "Automation server can't create object" a couple of times after which the applications starts and works fine. The alerts come up only on one of the workstations. Any pointers on where I should look?
Regards,
Dutch
try the following IE setting: "Initialize and script ActiveX control not marked as safe."
May or may not apply to your case, but there are reported problems with the JScript Runtime throwing up errors when starting up Applets or Java WebStart applications when you have specific network settings.
Every now and again, there's a Windows Update that generates such a bug and another one that follows to fix it and you'll see some of these errors. Yours might be one of these.
Usually the workaround in-between is to either:
go to IE's Network Settings and uncheck "auto detect settings" or any PAC file setting
or go to the Java control panel's Network Settings and disable "Use browser settings" or other settings to use a direct connection instead.
Obviously, that workaround is only valid if you do not have to go through a proxy...

Testing onbeforeunload events from Selenium

I'm trying to write a Selenium test for a web page that uses an onbeforeunload event to prompt the user before leaving. Selenium doesn't seem to recognize the confirmation dialog that comes up, or to provide a way to hit OK or Cancel. Is there any way to do this? I'm using the Java Selenium driver, if that's relevant.
You could write a user extension (or just some JavaScript in a storeEval etc) that tests that window.onbeforeunload is set, and then replaces it with null before continuing on from the page. Ugly, but ought to get you off the page.
I've just had to do this for an application of mine where the onbeforeunload handler brings up a prompt if a user leaves a page while a document is in an unsaved state. Python code:
driver.switch_to.alert.accept()
The Java equivalent would be:
driver.switchTo().alert().accept();
If the alert does not exist, the code above will fail with a NoAlertPresentException so there is no need for a separate test to check the existence before accepting the prompt.
I'm running Selenium 2.43.0 but I think this has been doable for a while now.
In cases where I don't want the prompt to come up at all because that's not what I'm testing, I run custom JavaScript in the browser to set window.onbeforeunload to null before leaving the page. I put this in the test teardown code.
faced same problem with "beforeunlaod" event listner, LUMINUS! a chrome addon that helps me just block the event listener in the plugin thats all..
When I was confronted with limited control which I had over browser using Selenium, I turned to MozLab plugin which solved my problem if only for one browser platform.

Categories

Resources