Answered question

Why NLWebDriverFactory.AddProxyCapabilitiesIfNecessary not working?

I am trying to integrate Selenium with Neoload in C#. But in C# I am not able to set the NeoLoad proxy using the code snippet below, because now InternetExplorerDriver constructor doesn't accept DesiredCapabilities , instead it accepts "InternetExplorerOptions".

InternetExplorerDriver webDriver = new InternetExplorerDriver(NLWebDriverFactory.AddProxyCapabilitiesIfNecessary(new DesiredCapabilities()));

Please look at the attached source code for your reference.

Arijit B.
Arijit B.

Arijit B.

Level
0
4 / 100
points
Alexis N.
Alexis N.

Alexis N.

Level
1
579 / 750
points
Team

Hi,

You can use the following code to update IE options according to capabilities:

DesiredCapabilities desiredCapability = new DesiredCapabilities();
NLWebDriverFactory.AddProxyCapabilitiesIfNecessary(cap);
object proxyCapability = desiredCapability.GetCapability(CapabilityType.Proxy);
InternetExplorerOptions options = new InternetExplorerOptions();
if (proxyCapability != null)
{
options.Proxy = proxyCapability as Proxy;
}

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful