[英]How to test or simulate draging a file from desktop to browser in selenium webdriver using Java
How to test draging a file from desktop to browser in selenium webdriver using java? 如何使用Java在selenium webdriver中测试将文件从桌面拖到浏览器中? I know we can do in Helium, but we are not ready for commercial product.
我知道我们可以在氦气中做,但我们还没有准备好商业化产品。
Maybe Using PyWinAuto you can achieve this, but it will not be consistent as Pywinauto does not Support Web Based Applications. 也许使用PyWinAuto可以实现此目的,但是由于Pywinauto不支持基于Web的应用程序,因此并不一致。
Steps Can be-
Step 1 - Minimize ur browser using Pywinauto Window.Minimize Method.
Step 2- Mouse Click and Hold on the Icon
Step 3 - Maximize ur Broser using Window.Maximize
Step 4- Click on any coordinate on the browser and release the mouse.
But It may not be a full proof solution. 但这可能不是一个完整的解决方案。
Try Autoit for this scenario. 对于这种情况,请尝试“ 自动 ”。
Dig this one: http://seleniumeasy.com/selenium-tutorials/upload-a-file-using-selenium-webdriver-with-autoit 挖这个: http : //seleniumeasy.com/selenium-tutorials/upload-a-file-using-selenium-webdriver-with-autoit
Attach() Func Attach() WinWait("Open") While True $win = WinWait("Open", "") ControlFocus($win, "", "Open") Send("{t 1}") Send("{e 1}") Send("{s 1}") Send("{t 1}") Send("{. 1}") Send("{p 1}") Send("{n 1}") Send("{g 1}") Sleep(2000) ControlClick($win, "", "[CLASS:Button; INSTANCE:1]") WinWaitClose($win) Wend EndFunc
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.