开发者

In Selenium 1, why are all the browser commands prefixed with an asterix?

Running Selenium 1 locally (not through grid) all the supported browser strings are prefixed by *. Assuming Selenium-Server has already been started

return new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com");

Is this just a convention, or does it hav开发者_运维知识库e some functional purpose? Note that we executing with an unsupported browser type is a nice way to get a list of the supported browsers.

return new DefaultSelenium("localhost", 4444, "firefox", "http://www.google.com");


When you add an asterisk in front of the browser name, you are telling selenium to treat it as a "special browser setting", which will allow selenium to automatically configure it if needed (for example disable pop-up blocking). It is recommended to use this option. For further details see here and here in selenium documentation.

from the same links:

"browserString" MUST be either an absolute file path to a browser executable, or a special string starting with an asterisk '*'. (See the next section for details.)

and

Supporting the following special browserStrings is RECOMMENDED:

*firefox *iexplore *opera *netscape *konqueror *safari *seamonkey *omniweb *camino The Server MAY support other special browserStrings.

If the Client Driver issues a "getNewBrowserSession" Command Request for one of these strings, the Server SHOULD launch the specified browser.

When the Server launches the browser using a special browserString, the Server MAY automatically configure the browser in a way that makes it suitable for automated testing. For example the Server MAY disable pop-up blocking or unnecessary security prompts.

The Server MAY allow options to be specified in the browserString, by appending them to one of the supported browserStrings. For example, the Server MAY allow the Client Driver to specify an absolute path to Firefox while the Server automatically configures it by accepting the browserString "*firefox c:\firefox\firefox.exe".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜