Selenium
天涯飘雪
aaa
展开
-
Selenium_AndroidDriver
IntroductionAndroid WebDriver allows to run automated end-to-end tests that ensure your site works correctly when viewed from the Android browser. Android WebDriver supports all core WebDriver API转载 2013-03-13 15:54:21 · 4055 阅读 · 0 评论 -
WebDriver_Java基本UI控件操作
1. 文本框Textbox // Find the username input element by its name WebElement username = driver.findElement(By.name("username")); // Enter the user name: jill username.clear();转载 2013-09-09 16:42:28 · 1028 阅读 · 0 评论 -
WebDriver_Java(等待页面元素加载完成)
web的自动化测试中,我们经常会遇到这样一种情况:当我们的程序执行时需要页面某个元素,而此时这个元素还未加载完成,这时我们的程序就会报错。怎么办?等待。等待元素出现后再进行对这个元素的操作。在selenium-webdriver中我们用两种方式进行等待:明确的等待和隐性的等待。 一、明确的等待明确的等待是指在代码进行下一步操作之前等待某一个条件的发生。最不好的情况是使用Thread转载 2013-09-10 16:18:44 · 3915 阅读 · 0 评论 -
Selenium 2入门
简介Selenium 是用于测试 Web 应用程序用户界面 (UI) 的常用框架。它是一款用于运行端到端功能测试的超强工具。您可以使用多个编程语言编写测试,并且 Selenium 能够在一个或多个浏览器中执行这些测试。Selenium(以下简称为 Selenium 1)并不是能够在浏览器中自动化功能测试的惟一工具。由 Simon Stewart(来自 Google)创建的 WebDrive转载 2013-09-04 14:28:42 · 1556 阅读 · 0 评论 -
Selenium_Java实例代码(1)
import static org.junit.Assert.*;import java.util.*;import org.junit.*;import org.openqa.selenium.*;import org.openqa.selenium.chrome.ChromeDriver;import org.openqa.selenium.ie.InternetExplo原创 2013-09-03 18:32:35 · 1509 阅读 · 0 评论 -
WebDriver_Java实例代码(getWindowHandles)
import org.openqa.selenium.*;import org.openqa.selenium.WebDriver.*;import org.openqa.selenium.firefox.*;public class WebDriver_SwitchWindow {public static void main(String[] args) throws Int原创 2013-09-10 14:19:35 · 6028 阅读 · 0 评论 -
Selenium_Java实例代码(2)
package cn.selenium2.test;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.firefox.FirefoxDriver;public原创 2013-09-05 15:05:07 · 1049 阅读 · 0 评论 -
Selenium_Java实例代码(3)
package cn.selenium2.test;import static org.junit.Assert.*;import java.util.List;import org.openqa.selenium.By;import org.openqa.selenium.JavascriptExecutor;import org.openqa.selenium.WebD原创 2013-09-05 15:37:11 · 1664 阅读 · 0 评论 -
Selenium知识点总结
1.浏览器列表:*firefox *mock *firefoxproxy *pifirefox *chrome *iexploreproxy *iexplore *firefox3 *safariproxy *googlechrome *konqueror *firefox2 *safari *piiexplore *firefox原创 2013-08-27 21:50:36 · 1203 阅读 · 0 评论 -
Selenium_selenium-webdriver(python) (十一) -- 控制滚动条到底部
有时候我们需要控制页面滚动条上的滚动条,但滚动条并非页面上的元素,这个时候就需要借助js是来进行操作。一般用到操作滚动条的会两个场景: 注册时的法律条文需要阅读,判断用户是否阅读的标准是:滚动条是否拉到最下方。 要操作的页面元素不在吸视范围,无法进行操作,需要拖动滚动条其实,实现这个功能只要一行代码,但由于不懂js ,所以花了不小力气找到这种方法。用于标识滚动条位置的代码转载 2014-01-03 16:07:10 · 5434 阅读 · 0 评论 -
Appium_python code(2)
# coding:utf8import loggingimport histsimilarimport tracebackimport timeimport osfrom selenium import webdriverfrom selenium.common.exceptions import NoSuchElementException, WebDriverException转载 2014-01-10 16:46:52 · 1429 阅读 · 0 评论 -
Appium_python code(1)
#-*-coding:utf-8 -*-import osfrom selenium import webdriverimport timeimport json# Returns abs path relative to this file and not cwdPATH = lambda p: os.path.abspath( os.path.join(o原创 2014-01-10 09:27:57 · 1276 阅读 · 0 评论 -
Appium_问题总结
今天打开appiumForWindow后,用python打开android设备上的客户端,出现问题如下:问题一:selenium.common.exceptions.WebDriverException: Message: u'A new session could not be created. (Original error: Could not extract PIDs from p原创 2014-01-08 15:40:47 · 4673 阅读 · 0 评论 -
Appium_Java code(1)
import java.io.File;import java.net.MalformedURLException;import java.net.URL;import java.util.concurrent.TimeUnit;import org.junit.After;import org.junit.Before;import org.junit.Test;转载 2014-01-15 09:11:15 · 1208 阅读 · 0 评论 -
selenium+testng+reprotng+ant框架搭建配置
一、Configure1. 安装testNG插件到eclipse.-) 选择菜单 Help /Software updates / Find and Install.-) 点击add button然后在location中输入http://beust.com/eclipse/-) 确定后会自动安装testNG插件。2. 在使用ant时候先将jdk的tools.jar引入进来。(不转载 2013-09-02 14:38:25 · 1194 阅读 · 0 评论 -
Webdriver_Ruby实例代码(1)
require 'watir-webdriver'b = Watir::Browser.newb.goto 'bit.ly/watir-webdriver-demo'b.text_field(:id => 'entry_0').set 'your name'b.select_list(:id => 'entry_1').select 'Ruby'b.select_list(:i转载 2013-09-06 17:56:30 · 961 阅读 · 0 评论 -
Selenium_Selenium for Android: MonkeyTalk Installation and Use
This guide will explain how to do automated testing on the android emulator using Gorilla Logic MonkeyTalk. To do this you must have a working installation of Eclipse IDE, ADT Plugin, Android sdk, an转载 2013-03-14 11:48:36 · 1340 阅读 · 0 评论 -
Selenium_Selenium 使用介绍
Selenium 是 thoughtworks公司的一个集成测试的强大工具。最近参与了一个系统移植的项目,正好用到这个工具,把一些使用心得分享给大家,希望大家能多多使用这样的强大的,免费的工具,来保证我们的质量。Selenium 的文档现存的不少,不过都太简单了。使用Selenium的时候,我更多的是直接去看API文档,好在API不错,一个一个看,就能找到所需要的 :-)转载 2013-03-14 10:11:10 · 554 阅读 · 0 评论 -
Selenium_Java Selenium起步
本篇文章初步介绍使用Java+Selenium进行web的自动化测试, 仅仅是起步!!!!1. 环境准备 1.1 Java环境安装, 配置jdk 1.2 Java IDE因为Selenium支持Java/C#/Ruby/Python/Perl等,这里选择用Java。到Eclipse官方网站下载Eclipse, 解压 1.3 Selenium到Seleniu转载 2013-03-14 11:00:41 · 715 阅读 · 0 评论 -
Selenium_官方文档:Selenium RC 安装步骤
“安装”这个词对于Selenium是不贴切的。Selenium为你所选择的编程语言提供了一些可用的库文件。你可以从这个网址下载 downloads page。一旦你选择了一种语言来执行测试,那么只需要做以下简单的操作:“安装”Selenium Server;用Selenium库所支持的其中一种语言,编写测试程序。安装 Selenium ServerSelenium Server是个转载 2013-03-14 14:01:47 · 1789 阅读 · 0 评论 -
Selenium_Ruby的安装
今天学习selenium+webdriver需要用的ruby,正好学习一下。打开Terminal,输入:ruby -v,提示命令不可用,所以需要安装Ruby的运行环境。 运行:sudo apt-get install ruby,提示输入密码,可是输入密码后,提示没有权限,不知道怎么回事儿。当然是就运行了一下:sudo passwd root,为root账户设置了密码。而后,再次运行安装命令转载 2013-03-15 14:38:12 · 777 阅读 · 0 评论 -
Selenium_slf4j配置实例
1、 简介SLF4J不是具体的日志解决方案,它只服务于各种各样的日志系统。按照官方的说法,SLF4J是一个用于日志系统的简单Facade,允许最终用户在部署其应用时使用其所希望的日志系统。实际上,SLF4J所提供的核心API是一些接口以及一个LoggerFactory的工厂类。从某种程度上,SLF4J有点类似JDBC,不过比JDBC更简单,在JDBC中,你需要指定驱动程序,而在使用SLF转载 2013-03-15 13:48:24 · 628 阅读 · 0 评论 -
Selenium_webdriver对 chrome driver的调用
今天在使用selenium +webdriver打开chrome,代码如下:from selenium import webdriverdriver=webdriver.Chrome()driver.get("www.google.com")运行代码后会出现如下错误:Traceback (most recent call last): File "/Selenium_Py原创 2013-03-15 15:10:09 · 37947 阅读 · 6 评论 -
Webdriver_RubyGems 镜像 - 淘宝网
1.安装ruby gems$ gem sources --remove https://rubygems.org/$ gem sources -a http://ruby.taobao.org/$ gem sources -l*** CURRENT SOURCES ***http://ruby.taobao.org# 请确保只有 ruby.taobao.org$ gem转载 2013-09-06 09:31:54 · 989 阅读 · 0 评论 -
Webdriver_Web Elements
All HTML elements are supported by Watir-WebDriver. Some examples are below:Text Fieldsrequire 'watir-webdriver'b = Watir::Browser.start 'bit.ly/watir-webdriver-demo't = b.text_field :id =转载 2013-09-07 00:03:35 · 876 阅读 · 0 评论 -
Watir-webdriver_Firefox
It just works™Firefox is supported through a JavaScript driver, therefore ‘it just works™’ on all platforms.b = Watir::Browser.new :firefoxFirefox ProfilesBy default, the Firefox driver create转载 2013-09-07 00:19:02 · 1166 阅读 · 0 评论 -
Watir-webdriver_ruby元素操作与定位
元素定位browser.element(how,what)常用元素*button*checkbox*text_field*form*frame*div*image*link*radio*select*table*text_area*file_field元素的操作:*click*set*clear*sel转载 2013-09-06 23:11:17 · 2442 阅读 · 0 评论 -
Webdriver_Ruby实例代码(2)
实例为点击百度首页的新闻,贴吧,音乐等,并打开相应页面require 'watir-webdriver'browser=Watir::Browser.new :chromebrowser.goto "http://www.baidu.com"#browser.text_field(:name=>'wd').set("WebDriver")#browser.button(:typ原创 2013-09-07 23:08:58 · 742 阅读 · 0 评论 -
Webdriver_Ruby实例代码(3)
require 'watir-webdriver'browser=Watir::Browser.start "http://www.baidu.com" :chromebroser.add_checker do |page| page.text.include?("Server Error") and puts "Application exception or 500 erro转载 2013-09-07 23:43:56 · 732 阅读 · 0 评论 -
Appium_学习笔记
今天使用appium 来测试android客户端,使用的是selenium + webdriver+ java,发现客户端的引导页无法操作,搜索到内容如下:1. 滚动条的滑动(http://www.cnblogs.com/nova/articles/1091993.html) top=document.documentElement.scrollTop; left=docu原创 2014-01-06 13:52:12 · 4292 阅读 · 1 评论