简体   繁体   English

如何测试或模拟使用Java在Selenium Webdriver中将文件从桌面拖动到浏览器

[英]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. 但这可能不是一个完整的解决方案。

 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.

相关问题 如何在 Java 中使用 selenium webdriver 模拟打印屏幕按钮 - How to simulate Print screen button using selenium webdriver in Java 如何使用Java和Selenium WebDriver从属性文件中调用方法? - How to call a method from property file using Java and Selenium WebDriver? 如何使用 Selenium WebDriver 在 Chromer 浏览器中测试下载文件是否成功 - How to test downloading a file happened successfully or not in Chromer browser using Selenium WebDriver 在Java中使用Selenium lib时,如何指定要模拟的浏览器? - How to specify which browser to simulate when using Selenium lib in Java? 如何在Java中使用Selenium WebDriver上传文件 - How to upload file using Selenium WebDriver in Java 使用Selenium Webdriver并行测试多个浏览器 - Multiple Browser in parallel test using Selenium Webdriver 如何使用Selenium WebDriver + Java获取浏览器控制台错误消息? - How to get browser console error messages using Selenium WebDriver + Java? 如何通过将Selenium WebDriver与Java一起在同一浏览器中打开新标签页? - How to open a new tab in the same browser by using Selenium WebDriver with Java? 如何使用Java关闭Selenium WebDriver中的子浏览器窗口 - How to close child browser window in Selenium WebDriver using Java 如何使用 Selenium WebDriver + Java 获取浏览器实例的 PID? - How to get PID of a browser instance using Selenium WebDriver + Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM