原创 如何獲取頁面中內嵌frame中的元素

通過webdriver獲取頁面元素時,如果遇到該元素正好在一個內嵌frame中時,直接在頁面上使用driver.findElement是找不到的。 首先,應該通過xpath或其他方法,找到該frame WebElement we=driv

原创 python學習筆記-------發送郵件(純文本)

import smtplib from email.mime.text import MIMEText import sys import string length = len(sys.argv) if length !=2:

原创 webdriver實現窗口切換

獲取當前窗口 Object handle=driver.getWindowHandle(); 獲取所有窗口 Object[] handles=driver.getWindowHandles().toArray(); 切換至某個窗口 dri

原创 java.util.regex.PatternSyntaxException: Unclosed character class near index解決辦法

使用str.split("[")時,出現java.util.regex.PatternSyntaxException: Unclosed character class near index [ ^的問題 解決辦法爲在[加上\\轉義

原创 webelement中的方法getText()和getAttribute(java.lang.String name)

getText(): 獲取元素的visible內嵌文字。 如csdn首頁中的鏈接<a class="left" target="_blank" href="http://www.csdn.net" onclick="LogClickCou

原创 PyCrypto 安裝中的問題

configure error cannot run c compiled programs解決方案:關閉電腦防火牆 error unrecognized command line option mno cygwin:去掉C:\Pytho

原创 windows下安裝phpunit_selenium的一些問題

安裝phpunit selenium時執行命令:pear install phpunit/PHPUnit_Selenium,提示錯誤: phpunit/PHPUnit_Selenium requires PHP extension "cu

原创 使用ConfigParser模塊解析配置文件

python提供了ConfigParser模塊來解析配置文件,它解析的配置文件格式類似於ini配置文件,文件被分成若干個section,每個section中有具體的配置信息,例如 [mysqld] user = mysql pid-fi

原创 kafka單機安裝

最近一個項目要使用到kafka,所以看了一些資料,總結了一下單機的安裝方法。 一、1個broker 1.官網下載kafka wget http://mirrors.cnnic.cn/apache/kafka/0.8.2.1/kafka_

原创 自動化測試框架探索

現有的測試框架:java+selenium+testng,基於UI實現迴歸測試自動化 selenium:進行頁面元素交互 testng:組織用例 xml文件,properties文件:存儲數據配置。系統的配置文件放在properties文

原创 java/lang/NoClassDefFoundError: java/lang/Object

linux下安裝好jdk後,輸入命令java -version出以下問題: java/lang/NoClassDefFoundError: java/lang/Object 因爲在jdk/lib下tools.pack未被解壓成tools

原创 RPM should not be used directly install RPM packages, use Alien instead!

ubuntu下安裝rpm文件出錯: RPM should not be used directly install RPM packages, use Alien instead! 因爲ubuntu不再支持rpm文件,需要使用alien安

原创 This document has errors that must be fixed before using HTML Tidy to generate a tidied up version.

使用httpunit的 webconversation.getResponse(url)時,出現錯誤“This document has errors that must be fixed before using HTML Tidy t

原创 maven編譯錯誤

使用maven構建項目時,出如下錯誤: Failure executing javac, but could not parse the error: 錯誤:讀取 D:\localRepository\com\jcraft\jsch\0.

原创 linux下安裝pycharm問題

在linux下安裝pycharm,需要先安裝jdk,並配置好環境變量。但在安裝pycharm時仍會出現以下問題: Error: cannot start PyCharm No JDK found to run PyCharm. Pleas