How can I start InternetExplorerDriver using Selenium WebDriver

前端 未结 16 2444
半阙折子戏
半阙折子戏 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:35

    In the same way for Chrome Browser below are the things to be considered.

    Step 1-->Import files Required for Chrome :
    import org.openqa.selenium.chrome.*;

    Step 2--> Set the Path and initialize the Chrome Driver:

    System.setProperty("webdriver.chrome.driver","S:\\chromedriver_win32\\chromedriver.exe");
    

    Note: In Step 2 the location should point the chromedriver.exe file's storage location in your system drive

    step 3--> Create an instance of Chrome browser

    WebDriver driver = new ChromeDriver();
    

    Rest will be the same as...

    0 讨论(0)
  • 2020-12-30 17:36

    To run test cases in IE Browser make sure you have downloaded IE driver and you need to set the property as well.

    Below code will help you

    // This will set the driver
    System.setProperty("webdriver.ie.driver","driver path\\IEDriverServer.exe");
    
    // Initialise browser
    
    WebDriver driver=new InternetExplorerDriver();
    

    You can check IE Browser challenges with Selenium and complete code for more details

    0 讨论(0)
  • 2020-12-30 17:37

    It needs to set same Security level in all zones. To do that follow the steps below:

    1.Open IE

    2.Go to Tools -> Internet Options -> Security

    3.Set all zones (Internet, Local intranet, Trusted sites, Restricted sites) to the same protected mode, enabled or disabled should not matter.

    Finally, set Zoom level to 100% by right clicking on the gear located at the top right corner and enabling the status-bar. Default zoom level is now displayed at the lower right.

    0 讨论(0)
  • 2020-12-30 17:37

    Go to Tools -> Internet Options -> Security and Enable protection mode for all zones. It worked for me :)

    0 讨论(0)
  • 2020-12-30 17:40
    import org.openqa.selenium.WebDriver;
    
    import org.openqa.selenium.ie.*;
    
    public class IEclass {
    
    
    
    public static void main(String[] args) {
    
    System.setProperty("webdriver.ie.driver","S:\\IE and Chrome ServerDriver\\IEDriverServer.exe");
    
    WebDriver driver = new InternetExplorerDriver();
    
    driver.get("https://www.google.com");
      }
        }
    
    0 讨论(0)
  • 2020-12-30 17:44

    Enable protected mode for all zones You need to enable protected mode for all zones from Internet Options -> Security tab. To enable protected mode for all zones.

    http://codebit.in/question/1/selenium-webdriver-java-code-launch-internet-explorer-brow

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