How to check if java is enabled on Internet Explorer - java

I have tried navigator.javaEnabled() and this works as expected in Firefox but in IE11 returns TRUE.How can i detect if Java is enabled on IE9,10,11??

Related

selenium user profile in headless mode, chrome browser

Situation: i'm running chrome in headless mode (see arguments in section part of code), when i connect to page (let say i sign into the page before i run my app that's using selenium) i'm already login to page (because it's using existing profile and i login to page before i started my app) that's on first computer, correct PROFILE is used.
On second computer i'm running Chrome with same settings (same as on computer one) and when i go to the same page as on computer one i'm NOT login to the page (because the profile with existing session is not used)...
If i remove the --headless option everything works... however i want to running it in HEADLESSS mode with current profile used by chrome.
Driver: Chrome driver version 101
Java version: 15
Browser: Google Chrome (version 101.0.4951.64)
Operating system: both computers have Windows 10
Part of code:
String userP=getChromeUserProfilePath();
options.addArguments(String.format("--user-data-dir=%s",userP));
if(getChromeUserProfileName()!=null){
options.addArguments(String.format("--profile-directory=%s",getChromeUserProfileName()));
}
options.addArguments("--headless",
"--disable-gpu",
"--window-size=1920,1200",
"--ignore-certificate-errors",
"--disable-extensions",
"--no-sandbox",
"--disable-dev-shm-usage");
ChromeDriver webDriver = new ChromeDriver(options);
Questions:
Where's the catch ? How do i make it work for second computer?

How to turn off 'Enhanced Tracking Protection' for Firefox browser via Selenium WebDriver?

My Selenium Java test script runs on Firefox browser.
Recently, it has started failing on applications where 'Enhanced Tracking Protection' is turned on.
https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop
How can I disable/turn it off via Selenium Web Driver? Is there any preference or capability through which I can turn it off in the Firefox profile?
I'm using Selenium with PowerShell and I had the same issue.
This solution works for me
[OpenQA.Selenium.Firefox.FirefoxProfileManager]$ProfileManager= [OpenQA.Selenium.Firefox.FirefoxProfileManager]::new()
[OpenQA.Selenium.Firefox.FirefoxProfile]$FirefoxProfile = $ProfileManager.GetProfile($ProfileName)
$FirefoxProfile.SetPreference("pref.privacy.disable_button.tracking_protection_exceptions", $true)

How to make Google Chrome JavaScript console persistent using selenium webdriver?

How to make Google Chrome console persistent?
In Network tab their is a option "preserve logs" how to set this using selenium webdrver.
In case of firefox their is preference "devtools.webconsole.persistlog" If "devtools.webconsole.persistlog" is set to true then it will enable persistent logging(preserve logs). any equivalent preference/way in Chrome.?

Selenium tests does not run when Internet explorer 9 or Virtual machine is minimised

Internet Explorer - version 9
Selenium - 2.42.2
language - JAVA
What steps will reproduce the problem?
1.Trigger a login test on windows VM on IE with the following capabalities:
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS=true
InternetExplorerDriver.IGNORE_ZOOM_SETTING=true
InternetExplorerDriver.REQUIRE_WINDOW_FOCUS=true
InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING=true
InternetExplorerDriver.NATIVE_EVENTS=false
InternetExplorerDriver.INITIAL_BROWSER_URL="https://***********.com
2.Minimise the VM and
3.Wait for the selenium script to run and then maximise the VM to check if the tests are running fine.
What is the expected output? What do you see instead?
Expected Output: The login to the application should be completed.
Instead, the test is stuck in the login page. The user-id and password is not entered.(The webdriver is unable to identify the element)
Selenium version:2.42.2
OS:Windows 7
Browser:Internet Explorer
Browser version:9
The tests are triggered from jenkins server remotely. The tests run fine when it is in the foreground, but fails if the VM or IE is minimised.
If you are able to change the Protected Mode settings for each zone to same value (details are here). Then don't set following capability -
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS=true
And also try without setting following capabilities (make sure zoom level set to 100%) -
InternetExplorerDriver.IGNORE_ZOOM_SETTING=true
InternetExplorerDriver.REQUIRE_WINDOW_FOCUS=true

javascript check if java enabled in IE WITHOUT running jar

I wanna detect if java is enabled in a browser without running any jars.I did this in Chrome and Firefox with the navigator.plugins and it's working great, but in IE its returning always true.Any ideas?Thanx in advance.

Categories

Resources