How can I start InternetExplorerDriver using Selenium WebDriver

前端 未结 16 2445
半阙折子戏
半阙折子戏 2020-12-30 17:23

I downloaded the driver and I gave the exact path in my code but when I ran the code it shows me error

my code with java is as below:

System.out.prin         


        
相关标签:
16条回答
  • 2020-12-30 17:52

    First download the exe file of the IEDriverServer (64 bit and 32 bit). Don't need to install, only download this file with your browser( 64 or 32 bit) and simply give the path of the exe file in the given code.

    http://www.seleniumhq.org/download/

    use this code

    package myProject;
    
    import org.openqa.selenium.ie.InternetExplorerDriver;
    
    public class Browserlaunch {
    
        public static void main(String[] args) {
    
            System.setProperty("webdriver.ie.driver", "C:/Drivers/IEDriverServer.exe");
            InternetExplorerDriver IEDriver=new InternetExplorerDriver();
            IEDriver.get("http://localhost:8888");
        }
    }
    
    0 讨论(0)
  • 2020-12-30 17:53

    In c#, This can bypass changing protected zone settings.

    var options = new InternetExplorerOptions();
    options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
    options.ElementScrollBehavior = InternetExplorerElementScrollBehavior.Bottom;
    
    0 讨论(0)
  • 2020-12-30 17:54
    static WebDriver driver;
    System.setProperty("webdriver.ie.driver","C:\\(Path)\\IEDriverServer.exe");
    driver = new InternetExplorerDriver();
    driver.manage().window().maximize();
    driver.get("EnterURLHere");          
    driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
    
    0 讨论(0)
  • 2020-12-30 17:56

    I think you have to make some required configuration to start and run IE properly. You can find the guide at: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

    0 讨论(0)
提交回复
热议问题