Selenium: Drag and Drop from file system to WebDriver?

后端 未结 4 1552
野的像风
野的像风 2020-12-01 10:56

I have to test a web-application which contains a drag and drop area for uploading files from the local file system. My test environment is based on C#.

For the auto

4条回答
  •  有刺的猬
    2020-12-01 11:44

    The previous answer is correct and works perfectly with the Chrome driver, however might have problems with Mozilla Gecko driver, which throws org.openqa.selenium.ElementNotVisibleException

    In order to avoid that, remove input.style.display = 'none';

    You can use input.style.opacity = 0; if you need to make it disappear.

提交回复
热议问题