Firefox profile settings and browser options versus desired IE features

I saw (and actually answered) several questions related to selenium, where you need to set some browser preferences in order to change its behavior, for example:

In other words, there are many questions that can be grouped into two types:

  • I know how to set this preference in browser X, how to do the same in browser Y?
  • How to make browser X, Y and Z do something by adjusting their settings?

Usually this is done using setup / configuration:

  • FirefoxProfile for Firefox
  • ChromeOptions for Chrome
  • DesiredCapabilities for Internet Explorer

What is the preferred and most effective browser-specific solution strategy for a particular problem? Is there a comparison between preferences between major browsers?

For example, I found that to disable the cache in Firefox, I can set browser.cache.disk.enable , browser.cache.memory.enable , browser.cache.offline.enable and network.http.use-cache preferences false . How to learn how to do the same in Chrome and IE?

+6
source share
1 answer

To emphasize what I mean, there will be a crunch down Wikipedia article to 1 sentence:

Selenium WebDriver ... - , implemented through a browser-based browser driver , which ... is designed to provide a basic set of building blocks from which developers can create their own domain-specific language .

What is the preferred and most effective strategy for finding browser-specific solutions for a particular problem?

Rather, try to think this way: if a particular browser implements a function, then there is a good chance that the selenium driver opens it. You know, if a function is implemented, if you can solve it manually.

I am a truly effective problem-solving algorithm for you: CS || RTM || UTSL CS || RTM || UTSL

  • [CS] Can you solve the problem manually? Try using the same steps.
  • [RTM] Can you find a guide or an example? Most likely, others have solved your problem.
  • [UTSL] If common sense and RTM do not work, then
    • Management can tell you how the material should work .
    • A source can tell you how it works. .

enter image description here Image from Jeff Atwood post .

Is there a comparison between preferences between major browsers?

No , preferences are not consolidated among drivers. Drivers have features and trade-offs .

Different browsers or even browser versions support different sets of features. Some of them lack even general things. Some of these functions are coated with selenium to provide the basic functionality that it has. An example of this will be older. IE does not support xPath, and Selenium should mimic this behavior. You cannot assume that it adds behavior to take into account every quirk in every browser in order to create a common platform (which would be an evil problem).

I suggest you read The Evil Problem: Strategies for Solving Evil Problems .

Knowing how to disable the cache in Firefox, how can I find out how to do the same in ...?

To do the same in chrome, you can run the chrome driver with the argument --disable-application-cache . To find out what flags your current Chrome can set, you can go to chrome://flags/ inside chrome. An alternative way would be to find affordable .

An alternate name for IE would be the quirks obscene application . Here you need to do some research. One way is to call RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess nr

Where nr flag field :

  • 255 (deletes ALL history)
  • 1 (deletes only history)
  • 2 (deletes cookies only)
  • 8 (removes temporary Internet Files only)
  • 16 (deletes only form data)
  • 32 (deletes only password history)

This source claims that since May 2013, IE may have wishCapabilities.ensureCleanSession to clear the cache, however I have not tested it.

+5
source

Source: https://habr.com/ru/post/975100/


All Articles