随笔分类 -  Selenium

摘要:driver.switch_to.frame(driver.find_element(By.CSS_SELECTOR,'iframe')) #跳转到iframe time.sleep(5) InputButton = driver.find_element(By.LINK_TEXT,'GO') #在 阅读全文
posted @ 2023-06-20 17:00 *飞飞* 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Agents = [' (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B5097d', ' (Windows NT 5.1 阅读全文
posted @ 2023-06-15 16:39 *飞飞* 阅读(85) 评论(0) 推荐(0) 编辑
摘要:问题:页面F12可以定位元素,但把网页下载到本地,无法定位 2种原因: 1、内容在一个标签中,放在json字符串里 # 内容在input里 inputInfo = soup.find_all('input')[3]['value'] #页面所有内容 xmInfo = json.loads(input 阅读全文
posted @ 2023-06-15 16:23 *飞飞* 阅读(105) 评论(0) 推荐(0) 编辑
摘要:0、初始化: from bs4 import BeautifulSoup pageSource = driver.page_source soup = BeautifulSoup(pageSource,'html.parser') 1、标签名定位 方法1: soup.body 方法2: li.sel 阅读全文
posted @ 2023-06-15 16:12 *飞飞* 阅读(481) 评论(0) 推荐(0) 编辑
摘要:元素定位 方法 描述 By.ID 根据id值获取对应的节点 By.NAME 根据name值获取对应的单个或多个节点 By.TAG_NAME 根据节点名获取节点 By.CLASS_NAME 根据class值获取节点 By.LINK_TEXT 根据链接文本获取对应的节点 By.PARTIAL_LINK_ 阅读全文
posted @ 2023-03-26 17:33 *飞飞* 阅读(33) 评论(0) 推荐(0) 编辑
摘要:浏览器 地址 Chrome https://registry.npmmirror.com/binary.html?path=chromedriver/ http://chromedriver.storage.googleapis.com/index.html Edge https://develop 阅读全文
posted @ 2023-03-22 09:16 *飞飞* 阅读(72) 评论(0) 推荐(0) 编辑
摘要:python : https://www.cnblogs.com/yan-xiang/p/6819168.html 操作内容:获取table总行数、总列数、获取某单元格的text值,删除一行【如果每行后边提供删除的按钮】 案例: HTML代码: <html><head><meta http-equi 阅读全文
posted @ 2018-01-02 11:32 *飞飞* 阅读(439) 评论(0) 推荐(0) 编辑
摘要:Selenium Grid 支持分布式测试,使测试人员可在分布式环境中进行测试一般而言,在面临以下情况时可考虑使用Selenium Grid :1.测试多个浏览器或单个浏览器多个版本,或测试不同操作系统上各种浏览器2.减少测试套件运行时间Selenium Grid 包含一个Hub 和至少一个 Nod... 阅读全文
posted @ 2015-07-01 16:32 *飞飞* 阅读(866) 评论(0) 推荐(0) 编辑
摘要:(1) new WebDriverWait(driver, 10). until(ExpectedConditions.elementToBeClickable(locator));(2) new WebDriverWait(driver, 10). until(ExpectedConditions... 阅读全文
posted @ 2015-06-26 16:40 *飞飞* 阅读(550) 评论(0) 推荐(0) 编辑
摘要:1. jsclick 也不管用 Actions action = new Actions(driver); WebElement theRow = page.getInvisibleElement(); action.moveToElement(theRow).perform(); page.get 阅读全文
posted @ 2015-06-24 17:07 *飞飞* 阅读(310) 评论(0) 推荐(0) 编辑
摘要:从 Selenium 的官方文档来看,推荐用户使用ios-driver 或 appium 而不是官方发布的 iPone Driver. 他们的地址分别是:http://ios-driver.github.io/ios-driverhttp://appium.io/1、Appium 简介:Appium... 阅读全文
posted @ 2015-06-17 16:36 *飞飞* 阅读(725) 评论(0) 推荐(0) 编辑
摘要:从 Selenium 的官方文档来看,推荐用户使用ios-driver 或 appium 而不是官方发布的 iPone Driver. 他们的地址分别是:http://ios-driver.github.io/ios-driverhttp://appium.io/ios-driver 基于2种不同的... 阅读全文
posted @ 2015-06-16 17:21 *飞飞* 阅读(2902) 评论(0) 推荐(0) 编辑
摘要:HTML5 中引入了Application Cache,这意味着 Web 应用程序可以被缓存到本地,且可在没有网络的情况下也能访问该 Web 应用程序Application Cache 在以下3个方面具有明显优势1.离线浏览:在没有网络情况下用户也可使用 Web 应用程序2.速度快:缓存的资源被加载... 阅读全文
posted @ 2015-06-08 15:37 *飞飞* 阅读(552) 评论(0) 推荐(0) 编辑
摘要:在 HTML5 中,Web Storage 这个新特性可让用户将数据存储在本地的浏览器中。在早期的浏览器中可通过 cookies 来完成这个任务,但 Web Storage 会更加安全和高效,且Web Storage 通过键值对进行存储,只有自身的网页应用才可以访问存储的数据Web Storage ... 阅读全文
posted @ 2015-06-08 15:15 *飞飞* 阅读(768) 评论(0) 推荐(0) 编辑
摘要:package com.learingselenium.android;import junit.framework.TestCaseimport org.openqa.selenium.Rotatable;import org.openqa.selenium.ScreenOrientation;i... 阅读全文
posted @ 2015-06-08 14:58 *飞飞* 阅读(1113) 评论(0) 推荐(0) 编辑
摘要:1.安装 Android SDK到如下网址下载Android SDKhttp://developer.android.com/sdk/index.html2.创建Android 虚拟设备解包刚下载的SDK 压缩包,进入 tools 目录,然后启动 AVD 管理器(Android Virtual De... 阅读全文
posted @ 2015-06-05 17:18 *飞飞* 阅读(1927) 评论(0) 推荐(1) 编辑
摘要:在 HTML5 ,新特性Geolocation 用于定位用户位置信息。由于用户位置信息是敏感信息,所以需要得到用户允许后,才能让程序通过 API 获取当前用户信息。WebDriver 程序每次重新允许都是新的会话进程,及时之前在浏览器中已经通过手工方式运行浏览器访问用户的位置信息,但在当前运行环境中... 阅读全文
posted @ 2015-06-05 15:45 *飞飞* 阅读(370) 评论(0) 推荐(0) 编辑
摘要:以 jQuery UI 官方网站元素测试,地址:http://jqueryui.com/draggable/示例:package com.learningselenium.html5;import java.util.NoSuchElementException;import org.junit.A... 阅读全文
posted @ 2015-06-05 15:15 *飞飞* 阅读(1875) 评论(0) 推荐(0) 编辑
摘要:测试http://literallycanvas.com/以 Chrome Driver 为例阐述,通过 Actions 在 Canvas 上绘制一个封闭图形。对于 Canvas 上的操作,推荐 Chrome Driver 或 Firefox Driver示例:package com.learnin... 阅读全文
posted @ 2015-06-05 14:58 *飞飞* 阅读(1460) 评论(0) 推荐(1) 编辑
摘要:测试播放,停止播放http://www.videojs.com/示例:package com.learningselenium.html5;import static org.junit.Assert.*;import org.junit.*;import org.openqa.selenium.*... 阅读全文
posted @ 2015-06-05 14:29 *飞飞* 阅读(1253) 评论(0) 推荐(0) 编辑