0

To improve the performance of the automation, trying to disable image loading.

I found a way to do it in Firefox & Chrome (Ref: Selenium WebDriver/Firefox|Chrome/Java How to disable image loading), not Internet Explorer. Please help me out here.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Sandeep Nalla
  • 173
  • 2
  • 15

3 Answers3

1

Below is the answer, received from Selenium team.

Ref: https://github.com/SeleniumHQ/selenium/issues/7512

This isn’t possible without changing the browser configuration/profile, and IE does not support profiles outside the currently logged in Windows user account. The driver will not be modified to change the configuration, since there is no guaranteed way to revert the configuration change after the session ends. You can either manually set the browser configuration in the options dialog (if such a setting exists), manipulate the setting programmatically using the Windows registry (assuming such a setting exists for IE), or use a web proxy to block retrieval of images. This is not a feature the driver will be implementing.

Sandeep Nalla
  • 173
  • 2
  • 15
0

To improve the performance of the automated program disableing the image loading within you need to modify the data for the name Display Inline Images within HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main through the Registry Editor as no as follows:

Value name              Value data
---------------------   ----------
Display Inline Images   No

Snapshot:

IE_Display_inline_Images

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

To disable the images while browsing on Internet Explorer, you could open the Internet Options and go to the Advanced Tab. Scroll down to Multimedia Section and uncheck Show Pictures check-box, click Apply and Exit.

enter image description here

Zhi Lv
  • 18,845
  • 1
  • 19
  • 30
  • I need to run the test on remote machine. So the given solution doesn't work for me. Is there any way to handle through the selenium code(Desired capabilities)? – Sandeep Nalla Aug 20 '19 at 12:52
  • As far as I know, Internet Explorer doesn’t provide any option for disabling images through Selenium web driver, we could only disable it from IE internet options and Registry. You could post your problem on [selenium forum](https://github.com/SeleniumHQ/selenium/issues) or feedback this new feature from [here](https://github.com/SeleniumHQ/selenium/blob/master/CONTRIBUTING.md). – Zhi Lv Aug 21 '19 at 09:56
  • Opened a ticket in Selenium forum. https://github.com/SeleniumHQ/selenium/issues/7512 – Sandeep Nalla Aug 22 '19 at 06:14