Selenium Grid- Running a test in parallel on IE 11 - selenium-webdriver

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

Related

How to set up proxy settings for chrome driver webdriver samper in Jmeter

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

Failed to create an object instance for the specified ProgID (WIA.CommonDialog)

We are trying to allow users to scan documents using a Silverlight XAP running in-browser with elevated trust, from a remote server, and are getting the following error:
Unhandled Error in Silverlight Application Failed to create an object instance for the specified ProgID.
The failure is at the following line:
Dim CommonDialog = AutomationFactory.CreateObject("WIA.CommonDialog")
Application.Current.HasElevatedPermissions and AutomationFactory.IsAvailable both return True.
I can successfully create an instance of unsafe ActiveX controls, e.g. Scripting.FileSystemObject:
Dim fso = AutomationFactory.CreateObject("Scripting.FileSystemObject")
The code fails when running from the production environment on the remote server. When running from the ASP.NET Development server from localhost, the code succeeds, and the WIA scanning dialog is shown when calling CommonDialog.ShowAcquireImage().
How can I resolve this? (Is there perhaps something specific about WIA that prevents it from being used this way?) What steps can I take to try and debug this?
Update
When I try to open the generated Silverlight test page (via the file protocol), I get the same error.
Update 2
Process Monitor shows that the AllowLaunchOfElevatedTrustApps and AllowElevatedTrustAppsInBrowser keys are being successfully queried.
Update 3
With Protected Mode turned off, the code works.
The MSDN reference states that to enable COM Interop inside the browser, you must
Set Registry Key HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight\ (or on x64 HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Silverlight\) AllowElevatedTrustAppsInBrowser DWORD 0x0000001
Check your group policy has not disabled AllowInstallOfElevatedTrustApps and AllowLaunchOfElevatedTrustApps
Sign the .xap
Install cert to Trusted Application Store (see screenshots illustrating how)
Additionally, you must
configure as Out of Browser Application (even if you are not running Out of Browser)
before calling the ComAutomationFactory.CreateObject you should check for Application.Current.HasElevatedPermissions and AutomationFactory.IsAvailable
note that Elevated Permission testing from http://localhost and http://127.0.0.1 is not reliable test, as Silverlight runtime makes exception for these two URLs. Instead use file://.
Troubleshooting
Use ProcMon to verify that the AllowElevatedTrustAppsInBrowser registry key is being read
Attach Debugger to Silverlight (see screenshots)
MSIE Protected Mode settings can also adversely affect whether a Silverlight application can run with Elevated Permissions. Try running with different Protected Mode settings.

Modify timeout value when opening a remote webdriver?

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/

IE 9 getWindowHandles - Does not identify new browser window

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.

Cannot sign in with google app engine plugin

When trying to sign in using the button in the lower left corner of the screen, I am unable to do so because it needs a verification code. However, I am not offered the chance to receive one, it only brings me directly to the "allow this application page." The exact error in the log is
Could not sign in. Make sure that you entered the correct verification code.
Thanks for your help in advance.
I had the same issue, resolved by changing network settings as follows:
In Eclipse:
Preferences > General > Network Connections
Set Active Provider to Manual
Under Proxy entries, edit the HTTPS proxy, adding host and port info
Check "Requires authentication" and add your network ID and password
I had a similar problem on my Mac OS X.
However, after upgrading my JDK from 1.6 to 1.7 my problems disappeared.(Note: JDK not JRE)
The default java on Mac 10.x is Java SE 6 and you can't uninstall it. You can add Java 1.7 or higher and your system should automatically pick up the later version -you can check from the terminal with
$java -version

Resources