How to handle Windows file browse window using selenium webdriver

前端 未结 3 1996
失恋的感觉
失恋的感觉 2020-12-11 22:32

How to handle file window popup using selenium webdriver.

I have clicked on file browse button , new pop up window has been opened and i am unabled to handle this wi

3条回答
  •  青春惊慌失措
    2020-12-11 22:41

    I have a sample code for this:

    driver.get("http://www.2shared.com/");
            driver.findElement(By.id("upField")).sendKeys("D:\\james.xls");
            driver.findElement(By.xpath("//input[@title='Upload file']")).click();
        }
    

提交回复
热议问题