Watir Tutorial
Selected Reading
- Watir - Discussion
- Watir - Useful Resources
- Watir - Quick Guide
- Watir - Browser Windows
- Watir - Downloads
- Watir - Alerts
- Watir - Proxies
- Watir - Cookies
- Watir - Page Performance
- Watir - Page Objects
- Watir - Capturing Screenshots
- Watir - Mobile Testing
- Watir - Headless Testing
- Watir - Automatic Waits
- Watir - Working with Iframes
- Watir - Locating Web Elements
- Watir - Web Elements
- Watir - Working with Browsers
- Watir - Installing Drivers for Browsers
- Watir - Environment Setup
- Watir - Introduction
- Watir - Overview
- Watir - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Watir - Downloads
Watir - Downloads
我们有国歌或国歌,或我们的网站,下载了国歌或国歌。 我们可以通过向浏览器提供一些优惠,测试如何使用Watir。
下载的星号——
prefs = { download => { default_directory => "C:/download", prompt_for_download => false, } } b = Watir::Browser.new :chrome, options: {prefs: prefs}
这些预告已经下载,我们需要在下载后把档案储存起来的道路上,并且必须使用上文各行文中所示的备选办法向浏览器提供同样的信息。
这里举了一个工作例子。 在此,我们创建了一个纽州试验页面,被点击后将下载一个称为档案的档案。 a. 如下所示:
<html> <head> <title>Testing UI using Watir</title> </head> <body> <br/> <br/> <button id = "btnsubmit"> <a href = "file.txt" download>Cpck to Download!</a> </button> <br/> </body> </html>
file.txt
This is for testing watir download
Output
当你点击下载的纽顿时,该档案被下载。
现在,让我们用Watir来测试同样的情况:
require watir prefs = { download => { default_directory => "C:/download", prompt_for_download => false, } } b = Watir::Browser.new :chrome, options: {prefs: prefs} b.goto( http://localhost/uitesting/filedownload.html ) b.button(id: btnsubmit ).cpck b.screenshot.save testdownload.png
我们为存放下载的档案所走的道路是“C:/下载”。 当我们执行上述准则时,我们将在下载过程中下载以下文件:
产出测试下载荷。 页: 1
Advertisements