IE specific functionality These are capabilities and features specific to Microsoft Internet Explorer browsers.
As of June 2022, Selenium officially no longer supports standalone Internet Explorer.
The Internet Explorer driver still supports running Microsoft Edge in “IE Compatibility Mode.”
Special considerations The IE Driver is the only driver maintained by the Selenium Project directly.
While binaries for both the 32-bit and 64-bit
versions of Internet Explorer are available, there are some
known limitations
with the 64-bit driver. As such it is recommended to use the 32-bit driver.
Additional information about using Internet Explorer can be found on the
IE Driver Server page
Options Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with basic defined options looks like this:
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
driver = webdriver . Ie ( options = options )
driver . quit ()
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs
Copy
Close
using System ;
using System.IO ;
using Microsoft.VisualStudio.TestTools.UnitTesting ;
using OpenQA.Selenium.IE ;
using SeleniumDocs.TestSupport ;
namespace SeleniumDocs.Browsers
{
[TestClassCustom]
[EnabledOnOs("WINDOWS")]
public class InternetExplorerTest
{
[TestMethod]
public void BasicOptions ()
{
var options = new InternetExplorerOptions ();
var driver = new InternetExplorerDriver ( options );
driver . Quit ();
}
}
}
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
As of Internet Explorer Driver v4.5.0:
If IE is not present on the system (default in Windows 11), you do not need to
use the two parameters above. IE Driver will use Edge and will automatically locate it. If IE and Edge are both present on the system, you only need to set attaching to Edge,
IE Driver will automatically locate Edge on your system. So, if IE is not on the system, you only need:
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs
Copy
Close
using System ;
using System.IO ;
using Microsoft.VisualStudio.TestTools.UnitTesting ;
using OpenQA.Selenium.IE ;
using SeleniumDocs.TestSupport ;
namespace SeleniumDocs.Browsers
{
[TestClassCustom]
[EnabledOnOs("WINDOWS")]
public class InternetExplorerTest
{
[TestMethod]
public void BasicOptions ()
{
var options = new InternetExplorerOptions ();
var driver = new InternetExplorerDriver ( options );
driver . Quit ();
}
}
}
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
let driver = await new Builder ()
. forBrowser ( 'internet explorer' )
. setIEOptions ( options )
. build ();
val options = InternetExplorerOptions ()
val driver = InternetExplorerDriver ( options )
Here are a few common use cases with different capabilities:
fileUploadDialogTimeout In some environments, Internet Explorer may timeout when opening the
File Upload dialog. IEDriver has a default timeout of 1000ms, but you
can increase the timeout using the fileUploadDialogTimeout capability.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin InternetExplorerOptions options = new InternetExplorerOptions ();
options . waitForUploadDialogUpTo ( Duration . ofSeconds ( 2 ));
WebDriver driver = new RemoteWebDriver ( options );
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
var options = new InternetExplorerOptions ();
options . FileUploadDialogTimeout = TimeSpan . FromMilliseconds ( 2000 );
var driver = new RemoteWebDriver ( options );
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options (). fileUploadDialogTimeout ( 2000 );
let driver = await Builder ()
. setIeOptions ( options )
. build ();
val options = InternetExplorerOptions ()
options . waitForUploadDialogUpTo ( Duration . ofSeconds ( 2 ))
val driver = RemoteWebDriver ( options )
ensureCleanSession When set to true
, this capability clears the Cache,
Browser History and Cookies for all running instances
of InternetExplorer including those started manually
or by the driver. By default, it is set to false
.
Using this capability will cause performance drop while
launching the browser, as the driver will wait until the cache
gets cleared before launching the IE browser.
This capability accepts a Boolean value as parameter.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin InternetExplorerOptions options = new InternetExplorerOptions ();
options . destructivelyEnsureCleanSession ();
WebDriver driver = new RemoteWebDriver ( options );
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
var options = new InternetExplorerOptions ();
options . EnsureCleanSession = true ;
var driver = new RemoteWebDriver ( options );
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options (). ensureCleanSession ( true );
let driver = await Builder ()
. setIeOptions ( options )
. build ();
val options = InternetExplorerOptions ()
options . destructivelyEnsureCleanSession ()
val driver = RemoteWebDriver ( options )
ignoreZoomSetting InternetExplorer driver expects the browser zoom level to be 100%,
else the driver will throw an exception. This default behaviour
can be disabled by setting the ignoreZoomSetting to true .
This capability accepts a Boolean value as parameter.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin InternetExplorerOptions options = new InternetExplorerOptions ();
options . ignoreZoomSettings ();
WebDriver driver = new RemoteWebDriver ( options );
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
var options = new InternetExplorerOptions ();
options . IgnoreZoomLevel = true ;
var driver = new RemoteWebDriver ( options );
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options (). ignoreZoomSetting ( true );
let driver = await Builder ()
. setIeOptions ( options )
. build ();
val options = InternetExplorerOptions ()
options . ignoreZoomSettings ()
val driver = RemoteWebDriver ( options )
ignoreProtectedModeSettings Whether to skip the Protected Mode check while launching
a new IE session.
If not set and Protected Mode settings are not same for
all zones, an exception will be thrown by the driver.
If capability is set to true
, tests may
become flaky, unresponsive, or browsers may hang.
However, this is still by far a second-best choice,
and the first choice should always be to actually
set the Protected Mode settings of each zone manually.
If a user is using this property,
only a “best effort” at support will be given.
This capability accepts a Boolean value as parameter.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin InternetExplorerOptions options = new InternetExplorerOptions ();
options . introduceFlakinessByIgnoringSecurityDomains ();
WebDriver driver = new RemoteWebDriver ( options );
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
var options = new InternetExplorerOptions ();
options . IntroduceInstabilityByIgnoringProtectedModeSettings = true ;
var driver = new RemoteWebDriver ( options );
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options (). introduceFlakinessByIgnoringProtectedModeSettings ( true );
let driver = await Builder ()
. setIeOptions ( options )
. build ();
val options = InternetExplorerOptions ()
options . introduceFlakinessByIgnoringSecurityDomains ()
val driver = RemoteWebDriver ( options )
silent When set to true
, this capability suppresses the
diagnostic output of the IEDriverServer.
This capability accepts a Boolean value as parameter.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin InternetExplorerOptions options = new InternetExplorerOptions ();
options . setCapability ( "silent" , true );
WebDriver driver = new InternetExplorerDriver ( options );
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
InternetExplorerOptions options = new InternetExplorerOptions ();
options . AddAdditionalInternetExplorerOption ( "silent" , true );
IWebDriver driver = new InternetExplorerDriver ( options );
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const { Builder , By , Capabilities } = require ( 'selenium-webdriver' );
let caps = Capabilities . ie ();
caps . set ( 'silent' , true );
( async function example () {
let driver = await new Builder ()
. forBrowser ( 'internet explorer' )
. withCapabilities ( caps )
. build ();
try {
await driver . get ( 'http://www.google.com/ncr' );
}
finally {
await driver . quit ();
}
})();
import org.openqa.selenium.Capabilities
import org.openqa.selenium.ie.InternetExplorerDriver
import org.openqa.selenium.ie.InternetExplorerOptions
fun main () {
val options = InternetExplorerOptions ()
options . setCapability ( "silent" , true )
val driver = InternetExplorerDriver ( options )
try {
driver . get ( "https://google.com/ncr" )
val caps = driver . getCapabilities ()
println ( caps )
} finally {
driver . quit ()
}
}
Command-Line Options Internet Explorer includes several command-line options
that enable you to troubleshoot and configure the browser.
The following describes few supported command-line options
-private : Used to start IE in private browsing mode. This works for IE 8 and later versions.
-k : Starts Internet Explorer in kiosk mode.
The browser opens in a maximized window that does not display the address bar, the navigation buttons, or the status bar.
-extoff : Starts IE in no add-on mode.
This option specifically used to troubleshoot problems with browser add-ons. Works in IE 7 and later versions.
Note: forceCreateProcessApi should to enabled in-order for command line arguments to work.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin import org.openqa.selenium.Capabilities ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
public class ieTest {
public static void main ( String [] args ) {
InternetExplorerOptions options = new InternetExplorerOptions ();
options . useCreateProcessApiToLaunchIe ();
options . addCommandSwitches ( "-k" );
InternetExplorerDriver driver = new InternetExplorerDriver ( options );
try {
driver . get ( "https://google.com/ncr" );
Capabilities caps = driver . getCapabilities ();
System . out . println ( caps );
} finally {
driver . quit ();
}
}
}
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
using System ;
using OpenQA.Selenium ;
using OpenQA.Selenium.IE ;
namespace ieTest {
class Program {
static void Main ( string [] args ) {
InternetExplorerOptions options = new InternetExplorerOptions ();
options . ForceCreateProcessApi = true ;
options . BrowserCommandLineArguments = "-k" ;
IWebDriver driver = new InternetExplorerDriver ( options );
driver . Url = "https://google.com/ncr" ;
}
}
}
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options ();
options . addBrowserCommandSwitches ( '-k' );
options . addBrowserCommandSwitches ( '-private' );
options . forceCreateProcessApi ( true );
driver = await env . builder ()
. setIeOptions ( options )
. build ();
import org.openqa.selenium.Capabilities
import org.openqa.selenium.ie.InternetExplorerDriver
import org.openqa.selenium.ie.InternetExplorerOptions
fun main () {
val options = InternetExplorerOptions ()
options . useCreateProcessApiToLaunchIe ()
options . addCommandSwitches ( "-k" )
val driver = InternetExplorerDriver ( options )
try {
driver . get ( "https://google.com/ncr" )
val caps = driver . getCapabilities ()
println ( caps )
} finally {
driver . quit ()
}
}
forceCreateProcessApi Forces launching Internet Explorer
using the CreateProcess API. The default value is false.
For IE 8 and above, this option requires the
“TabProcGrowth” registry value to be set to 0.
Move Code
Java
Python
CSharp
Ruby
JavaScript
Kotlin import org.openqa.selenium.Capabilities ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
public class ieTest {
public static void main ( String [] args ) {
InternetExplorerOptions options = new InternetExplorerOptions ();
options . useCreateProcessApiToLaunchIe ();
InternetExplorerDriver driver = new InternetExplorerDriver ( options );
try {
driver . get ( "https://google.com/ncr" );
Capabilities caps = driver . getCapabilities ();
System . out . println ( caps );
} finally {
driver . quit ();
}
}
}
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
using System ;
using OpenQA.Selenium ;
using OpenQA.Selenium.IE ;
namespace ieTest {
class Program {
static void Main ( string [] args ) {
InternetExplorerOptions options = new InternetExplorerOptions ();
options . ForceCreateProcessApi = true ;
IWebDriver driver = new InternetExplorerDriver ( options );
driver . Url = "https://google.com/ncr" ;
}
}
}
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
const ie = require ( 'selenium-webdriver/ie' );
let options = new ie . Options ();
options . forceCreateProcessApi ( true );
driver = await env . builder ()
. setIeOptions ( options )
. build ();
import org.openqa.selenium.Capabilities
import org.openqa.selenium.ie.InternetExplorerDriver
import org.openqa.selenium.ie.InternetExplorerOptions
fun main () {
val options = InternetExplorerOptions ()
options . useCreateProcessApiToLaunchIe ()
val driver = InternetExplorerDriver ( options )
try {
driver . get ( "https://google.com/ncr" )
val caps = driver . getCapabilities ()
println ( caps )
} finally {
driver . quit ()
}
}
Service Service settings common to all browsers are described on the Service page .
Log output Getting driver logs can be helpful for debugging various issues. The Service class lets you
direct where the logs will go. Logging output is ignored unless the user directs it somewhere.
File output To change the logging output to save to a specific file:
Java
Python
CSharp
Ruby
JavaScript
Kotlin Selenium v4.10
/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
Note : Java also allows setting file output by System Property: Property key: InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY
Property value: String representing path to log file
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
Selenium v4.10
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
Console output To change the logging output to display in the console as STDOUT:
Java
Python
CSharp
Ruby
JavaScript
Kotlin Selenium v4.10
/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
Note : Java also allows setting console output by System Property; Property key: InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY
Property value: DriverService.LOG_STDOUT
or DriverService.LOG_STDERR
Selenium v4.11
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
Selenium v4.10
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
Log Level There are 6 available log levels: FATAL
, ERROR
, WARN
, INFO
, DEBUG
, and TRACE
If logging output is specified, the default level is FATAL
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
Note : Java also allows setting log level by System Property: Property key: InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY
Property value: String representation of InternetExplorerDriverLogLevel.DEBUG.toString()
enum
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs
Copy
Close
using System ;
using System.IO ;
using Microsoft.VisualStudio.TestTools.UnitTesting ;
using OpenQA.Selenium.IE ;
using SeleniumDocs.TestSupport ;
namespace SeleniumDocs.Browsers
{
[TestClassCustom]
[EnabledOnOs("WINDOWS")]
public class InternetExplorerTest
{
[TestMethod]
public void BasicOptions ()
{
var options = new InternetExplorerOptions ();
var driver = new InternetExplorerDriver ( options );
driver . Quit ();
}
}
}
Selenium v4.10
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end
Supporting Files Path
Java
Python
CSharp
Ruby
JavaScript
Kotlin /examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java
Copy
Close
package dev.selenium.browsers ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Test ;
import org.junit.jupiter.api.condition.EnabledOnOs ;
import org.junit.jupiter.api.condition.OS ;
import org.openqa.selenium.ie.InternetExplorerDriver ;
import org.openqa.selenium.ie.InternetExplorerOptions ;
@EnabledOnOs ( OS . WINDOWS )
public class InternetExplorerTest {
public InternetExplorerDriver driver ;
@AfterEach
public void quit () {
driver . quit ();
}
@Test
public void basicOptions () {
InternetExplorerOptions options = new InternetExplorerOptions ();
driver = new InternetExplorerDriver ( options );
}
}
**Note**: Java also allows setting log level by System Property:\
Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\
Property value: String representing path to supporting files directory
Selenium v4.11
/examples/python/tests/browsers/test_internet_explorer.py
Copy
Close
import sys
import pytest
from selenium import webdriver
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
@pytest.mark.skipif ( sys . platform != "win32" , reason = "requires Windows" )
def test_basic_options ():
options = InternetExplorerOptions ()
driver = webdriver . Ie ( options = options )
driver . quit ()
/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs
Copy
Close
using System ;
using System.IO ;
using Microsoft.VisualStudio.TestTools.UnitTesting ;
using OpenQA.Selenium.IE ;
using SeleniumDocs.TestSupport ;
namespace SeleniumDocs.Browsers
{
[TestClassCustom]
[EnabledOnOs("WINDOWS")]
public class InternetExplorerTest
{
[TestMethod]
public void BasicOptions ()
{
var options = new InternetExplorerOptions ();
var driver = new InternetExplorerDriver ( options );
driver . Quit ();
}
}
}
Selenium v4.8
/examples/ruby/spec/browsers/internet_explorer_spec.rb
Copy
Close
# frozen_string_literal: true
require 'spec_helper'
RSpec . describe 'Internet Explorer' , exclusive : { platform : :windows } do
it 'basic options' do
options = Selenium :: WebDriver :: Options . ie
@driver = Selenium :: WebDriver . for :ie , options : options
end
end