понедельник, 3 июня 2013 г.

Manual proxy support by Selenium

For work purposes i checked ability of Selenium to set up proxy for ie/ff/chrome/opera browsers in last days.

Main requirements are the following:

  • support of http and https proxying, 
  • parallel work at node level, 
  • direct specification of unique proxy host and port for each test (PAC/WPAD are excluded from checking due it is not supported by IE. that means that proxyType=manual is used).

Here is some results:

  • Opera - partially (HTTPS proxy is not set up: issue #5728 was created);
  • Firefox - all is ok (2 ways are supported - by proxy capability and using FF preferences);
  • Chrome - all is ok (2 ways are supported too - by proxy capability and using --proxy-server CLI switch);
  • IE - failed.
For IE old RC way to setup proxy is used - by Java WindowsProxymanager and hudsuckr utility a global proxy settings are set up at Windows registry. 
This leads to some conflicts at parallel setting of proxies by different processes, f.e.

Unable to start new session due WebDriverException() (Message: u'Cannot get output before executing command line: C:\\Windows\\system32\\reg.exe add HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Styles /v MaxScriptStatements /t REG_DWORD /d 2147483647 /f' ; Stacktrace: Method getStdOut threw an error in UnixProcess.java ). 9 retries is available.
or
Unable to start new session due WebDriverException() (Message: u'exec return code 1: \u040b\u0438\u0401\u040e\u0404\xa0: \u040c\u0490 \u0433\xa4\xa0\u0490\u0432\u0431\u043f \xad\xa0\xa9\u0432\u0401 \u0433\u0404\xa0\xa7\xa0\xad\xad\u043b\xa9 \u0430\xa0\xa7\xa4\u0490\xab \u0401\xab\u0401 \u0407\xa0\u0430\xa0\xac\u0490\u0432\u0430 \u045e \u0430\u0490\u0490\u0431\u0432\u0430\u0490.\r\n' ; Stacktrace: Method <init> threw an error in WindowsRegistryException.java ). 9 retries is available.

Also last process which set up proxy defines it for all existed processes.

Another thing i found was after IEdriver quiting proxy settings are sometimes not restored - 
looks like created Java thread (which should do it) is not executed or failed at some point. 


As result we'll not use proxying at all. Problem will be solved by replacing SUT configuration and creating mocks at another level.

Hope this helps.

Комментариев нет:

Отправить комментарий