watir

How to access and interact with Shadow DOM using Watir?

一曲冷凌霜 提交于 2020-12-26 11:08:29
问题 I need to access this page chrome://downloads/ and check that a file has been downloaded but it's Shadow DOM. I've found this article how to access DOM Elements With Selenium Webdriver. http://jeremysklarsky.github.io/blog/2015/06/13/accessing-shadow-dom-elements-with-selenium-webdriver/ But this is written in JS driver.executeScript("return $('body /deep/ <#yourSelector>')") driver.executeScript("return $('body /deep/ ._mm_column')[0].textContent").then(function(title){ title.should.contain

Selenium3自动化测试【3】:年度最佳自动化测试工具

微笑、不失礼 提交于 2020-10-05 01:13:07
年度最佳自动化测试工具 2019 年自动化测试工具的排名(不限于功能性测试或性能测试),供读者参考。 1. Selenium Selenium 目前是 B/S 应用程序最流行的开源测试自动化框架。 Selenium 经过十多年的发展,其已成为 Web 自动化测试人员的首选自动化框架,尤其适用于拥有高级编程和脚本编写技能的人员。 Selenium 已成为其他开源测试自动化工具的核心框架,如 Katalon Studio , Watir , Protractor 和 Robot Framework 。 Selenium 支持多种系统环境( Windows , Mac , Linux )和浏览器( Chrome , FireFox , IE 等浏览器)。 它的脚本可以用各种编程语言编写,如 Java , Python , C #, PHP , Ruby 和 Perl 。 测试人员可以灵活地(借助 Selenium IDE 实现录制与回访)使用 Selenium ,也可以通过开发语言( Python 、 Java 等)编写复杂的高级测试脚本来满足各种复杂场景的需要,但其扎实的开发语言基础。 地址: http://www.Seleniumhq.org/ 。 类型:开源。 1. Katalon Studio Katalon Studio 是一款功能强大的测试自动化解决方案,适用于 Web

百度质量部测试开发面试题

ぃ、小莉子 提交于 2020-08-11 08:14:34
目录 Chap1 测试基础 2 Chap2 测试设计 4 Chap3 算法 12 Chap4 设计题 19 Chap5 逻辑题 21 Chap6 编程及代码题 26 Chap7 计算机基础 38 1. C/C++ 38 2. JAVA 39 3. 多线程: 40 4. 网络编程 41 5. Linux : 43 Chap 8 项目和背景 47 Chap9 外部工具 48 1. Selenium 48 2. Ruby-Watir 49 3. QTP: 50 4. LoadRunner 51 Chap1 测试基础 附件1的19-21页是一个模拟的面试场景,其中有不少经典题型和问题。不过已经在网上广为流传,建议了解其中面试思路为主,题目不要照搬太多。 黑盒测试和白盒测试常用的测试方法有哪些?举例说明。 答:白盒测试:逻辑覆盖法,主要包括语句覆盖,判断覆盖,条件覆盖,判断条件覆盖,条件组合覆盖、路径覆盖。 黑盒测试:等价划分类,边界值分析,错误推测法等 静态测试和动态测试的概念。 答:静态方法是指不运行被测程序本身,仅通过分析或检查源程序的语法、结构、过程、接口等来检查程序的正确性。对需求规格说明书、软件设计说明书、源程序做结构分析、流程图分析、符号执行来找错。静态方法通过程序静态特性的分析,找出欠缺和可疑之处,例如不匹配的参数、不适当的循环嵌套和分支嵌套、不允许的递归、未使用过的变量

How to configure 'watir' to use an existing chrome user profile (created with chrome.exe --user-data-dir)

醉酒当歌 提交于 2020-05-15 04:24:05
问题 Is it possible to configure watir webdriver use an existing chrome user/profile ( created by chrome.exe --user-data-dir=C:\MyChromeUserProfile ) In Firefox it's possible to do the following: ( created a user profile with firefox -P ) profile = Selenium::WebDriver::Firefox::Profile.new(c://MyFFUserProfile) Watir::Browser.new :ff, :profile => profile For Chrome , I tried the following code to no avail: Watir::Browser.new :chrome, :switches => %w['--user-data-dir=c://MyChromeUserProfile'] While

How to configure 'watir' to use an existing chrome user profile (created with chrome.exe --user-data-dir)

拈花ヽ惹草 提交于 2020-05-15 04:24:03
问题 Is it possible to configure watir webdriver use an existing chrome user/profile ( created by chrome.exe --user-data-dir=C:\MyChromeUserProfile ) In Firefox it's possible to do the following: ( created a user profile with firefox -P ) profile = Selenium::WebDriver::Firefox::Profile.new(c://MyFFUserProfile) Watir::Browser.new :ff, :profile => profile For Chrome , I tried the following code to no avail: Watir::Browser.new :chrome, :switches => %w['--user-data-dir=c://MyChromeUserProfile'] While

Watir: How to retrieve all HTML elements that match an attribute? (class, id, title, etc)

我与影子孤独终老i 提交于 2020-02-07 01:47:08
问题 I have a page that is dynamically created and displays a list of products with their prices. Since it's dynamic, the same code is reused to create each product's information, so they share the tags and same classes. For instance: <div class="product"> <div class="name">Product A</div> <div class="details"> <span class="description">Description A goes here...</span> <span class="price">$ 180.00</span> </div> </div> <div class="product"> <div class="name">Product B</div> <div class="details">

Using gem Watir in Heroku - cannot find Chrome binary

泪湿孤枕 提交于 2020-02-06 07:27:04
问题 I am trying to scrap data in Heroku with the gem Watir but I have the following problem : Selenium::WebDriver::Error::UnknownError (unknown error: cannot find Chrome binary 2018-06-12T17:29:54.221948+00:00 app[web.1]: (Driver info: chromedriver=2.40.565383 I am using those 2 buildpackers : https://github.com/heroku/heroku-buildpack-google-chrome https://github.com/heroku/heroku-buildpack-chromedriver I don't understand how to fix the path in my rails project. As following this doc : https:/

how to scroll a web page using watir

老子叫甜甜 提交于 2020-01-31 04:31:15
问题 I am trying to scroll a web page to find and click on a content that is lazily loaded when the page is scrolled. I am using following command require 'watir-webdriver' @browser = Watir::new :firefox @browser.send_keys :space I am using web-driver with firefox and I am on ubuntu but it is not working. In the following ruby code I am trying to scroll the page down until I don't find the element with :id. The element is loading lazily. I am getting timeout after few seconds, any idea what is

FireWatir TextField set : Very Slow

荒凉一梦 提交于 2020-01-30 06:40:05
问题 When calling the set method of a text_field in ruby, the text is being entered at a very slow rate in the browser, roughly at 1 character / second. Environment Information: Ubuntu 10.10 FireFox 3.6.13 JSSh 0.9 Ruby 1.9.2p136 FireWatir 1.7.1 Kindly advice. Thanks in advance. 回答1: It is a known bug: WTR-397 Workaround is to use watir-webdriver or to use value= instead of set . Example: browser.text_field(how => what).value= "string" 回答2: solve slow key type issue on firewatir: need to edit the

FireWatir TextField set : Very Slow

纵然是瞬间 提交于 2020-01-30 06:38:26
问题 When calling the set method of a text_field in ruby, the text is being entered at a very slow rate in the browser, roughly at 1 character / second. Environment Information: Ubuntu 10.10 FireFox 3.6.13 JSSh 0.9 Ruby 1.9.2p136 FireWatir 1.7.1 Kindly advice. Thanks in advance. 回答1: It is a known bug: WTR-397 Workaround is to use watir-webdriver or to use value= instead of set . Example: browser.text_field(how => what).value= "string" 回答2: solve slow key type issue on firewatir: need to edit the