I am using Selenium 2.32, IEDriverServer 2.32, Eclipse, Java JDK 1.6.0_43 with Windows 7 and IE9. The code that i use to launch the driver is
File file = new File("IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
WebDriver driver = new InternetExplorerDriver(ieCapabilities);
In IE9, When i click on a link which opens a new browser, the driver.getWindowHandles() returns only one browser (Parent browser) and the new browser is never identified. When i use the same code with IE 8, it works and it identifies the new browser.
Due to company policy, the 'Security' settings are different for different zones in IE9. For two zones, the 'Enable Protected Mode' is enabled and while in other zones, the mode is not enabled. Is this the reason for the issue?. Please suggest.
Steps are as below:
'Enable Protected Mode' should be checked for all the zones and
security level should be set to "Medium".
Give some time to load the page using Thread.sleep(). Now you will
get correct value for getWindowHandles() method.
Related
I am trying to execute some scripts from our in-house existing framework on the safari browser on Saucelabs. As soon as the application is logged in I get the browser notification to Allow or Don't Allow but I am not able to interact with it.
I tried using all possible suggestions available, but nothing works.
SafariOptions browserOptions = new SafariOptions();
browserOptions.setCapability("platformName", "macOS 10.15");
browserOptions.setCapability("browserVersion", "latest");
Map<String, Object> sauceOptions = new HashMap<>();
Map<String, Object> pref = new HashMap<>();
pref.put("permissions.default.desktop-notification",0);
sauceOptions.put("screenResolution", "1024x768");
sauceOptions.put("customData",pref);
browserOptions.setCapability("sauce:options", sauceOptions);
browserOptions.setCapability("--disable-notifications", true);
How Do I take care of this? Did I miss anything in configurations? Please help. Thanks in advance
There is currently (Feb 2022) no way of blocking notification pop-ups for websites on Mobile Safari.
If this is your own site, I'd suggest disabling that feature during tests.
I am trying to run Jmeter Webdriver script in Blazemeter. The browser is getting launched but subsequent requests are failing. Further investigation it was identified that the chrome driver is not able to launch the expected URL due to proxy requirements.
I tried to use proxy settings in Jmeter Set Up Thread Group using JSR223 sampler.
Below is the code for the same.
With this I am getting "The driver is not executable error" in Blazemeter.
Proxy proxy = new Proxy();
proxy.setHTTPProxy("xyz.net:1234");
proxy.SslProxy("xyz.net:1234");
ChromeOptions options = new ChromeOptions();
options.setCapability ("proxy", proxy);
System.setProperty("webdriver.chromedriver", "chromedriver");
driver = new ChromeDriver(options);
I believe it's better to address this form of questions to BlazeMeter Support
The driver is not executable error doesn't have anything in common with proxies, you need to amend your chromedriver permissions to allow its execution)
Take the following steps:
Add setUp Thread Group to your test plan
Add OS Process Sampler to your Thread Group
Configure it as follows:
That's it, you should be able to launch the browser now
I want to run my test in parallel on Selenium Grid on IE browser 11.
I have one Hub machine(VDI machine) on which i have one node as well.
Machine 1 , Hub1 and Node1
For the second Node i have another VDI machine.
Machine 2 and Node2.
4.When i use Machine 1 , Hub1 and Node 1.
I can initiate IE browsers.
5.How ever when i use :-
Machine 1 , Hub1 and Node1
and
Machine 2 and Node2.
6.I can not initiate IE browser on both machines.
I get the Selenium webdriver error:-
"Protected mode must be set to the same value(enabled or disabled) for all zones."
How should i resolve this. I donot have the rights to change the security of the VDI machines.
"Protected mode must be set to the same value(enabled or disabled) for all zones."
You could follow the steps to make it work.
In IE, find Internet options and open it.
Go to the Security tab.
Set the value of the check box "Enable Protected Mode" to the same value, either checked or unchecked, for each zone.
I've checked this on my VM, it is possible to set the security of IE options.
Using selenium 4.1.1
InternetExplorerOptions ieOptions = new InternetExplorerOptions();
ieOptions.ignoreZoomSettings();
ieOptions.introduceFlakinessByIgnoringSecurityDomains();
ieOptions.setCapability("ignoreProtectedModeSettings", true);
ieOptions.setCapability("requireWindowFocus", true);
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444"), ieOptions);
setCapability("ignoreProtectedModeSettings", true); // Use this Capability to ignore protected mode settings
I am testing an application that requires login. Using SafariDriver when I click the "Keep Me Logged In" button every new SafariDriver instance that is created is automatically logged in as expected; but when I use FirefoxDriver or ChromeDriver I am asked for my credentials every time as if I've never logged to the site using that browser before (when I have both manually and using webdriver). Is there some setting I need to enable so FireFox and Chrome keep me logged in?
This happens because WebDriver creates a new FireFox profile for every session. These profiles include caches/bookmarks/plugins etc. for more information refer to the documentation. FirefoxDirver allows you to start a FireFox with a specific profile. This can be done by using the following code:
FirefoxProfile ff = new FirefoxProfile(new File("/Path/to/profile/directory"));
driver = new FirefoxDriver(ff);
I'll update the answer if I find the way to do this in chrome
We're using a 3rd party provider to run some our Selenium tests against browsers and devices we don't have here. One of these is an iPad.
Currently we open/instantiate the webdriver with this code in Ruby:
driver = Selenium::WebDriver.for(:remote, :url => url, :desired_capabilities => capabilities)
that works great when running against this 3rd party service if we're firing up instances of Chrome or FireFox. For iOS however they spin up a virtual machine with an iOS simulator, and very often the call above will timeout before the sim's browser is ready. They have acknowledged their VM startup times could be better.
But it is what it is. As far as practical next steps are concerned is there a way I can customize the timeout value when creating the remote webdriver?
What is the third party you are using? Is it by chance SauceLabs?
I'm not sure if this will work universally but you should be able to set timeout configurations on the desired capability object. Here's some sample code from my test project in java:
/**
* Sets the default capabilities for the RemoteWebDriver we use for SauceLabs
*
* #param capabilities the capabilities to set defaults to
* #return the DesiredCapabilities object after setting the default values
*/
private static DesiredCapabilities setDefaultCapabilities(DesiredCapabilities capabilities)
{
// Set job some defaults
capabilities.setCapability("max-duration", DEFAULT_TEST_TIMEOUT);
capabilities.setCapability("command-timeout", DEFAULT_COMMAND_TIMEOUT);
capabilities.setCapability("idle-timeout", DEFAULT_IDLE_TIMEOUT);
capabilities.setCapability("selenium-version", DEFAULT_SELENIUM_VERSION);
// Additional settings to help debugging and improve job perf
capabilities.setCapability("public", "share");
capabilities.setCapability("webdriver.remote.quietExceptions", false);
capabilities.setCapability("capture-html", true);
capabilities.setCapability("video-upload-on-pass", false);
return capabilities;
}
Here's the SauceLabs documentation for the capabilities: https://docs.saucelabs.com/reference/test-configuration/