Starts a new local session of Firefox.
Based on the combination and specificity of the various keyword arguments, a capabilities dictionary will be constructed that is passed to the remote end.
The keyword arguments given to this constructor are helpers to more easily allow Firefox WebDriver sessions to be customised with different options. They are mapped on to a capabilities dictionary that is passed on to the remote end.
As some of the options, such as firefox_profile and firefox_options.profile are mutually exclusive, precedence is given from how specific the setting is. capabilities is the least specific keyword argument, followed by firefox_options, followed by firefox_binary and firefox_profile.
In practice this means that if firefox_profile and firefox_options.profile are both set, the selected profile instance will always come from the most specific variable. In this case that would be firefox_profile. This will result in firefox_options.profile to be ignored because it is considered a less specific setting than the top-level firefox_profile keyword argument. Similarily, if you had specified a capabilities[“firefoxOptions”][“profile”] Base64 string, this would rank below firefox_options.profile.
Sets the context that Selenium commands are running in using a with statement. The state of the context on the server is saved before entering the block, and restored upon exiting it.
|Parameters:||context – Context, may be one of the class properties CONTEXT_CHROME or CONTEXT_CONTENT.|
with selenium.context(selenium.CONTEXT_CHROME): # chrome scope ... do stuff ...
Quits the driver and close every associated window.