原创 ActionChains的實現

在 WebDriver 中關於鼠標操作的方法由 ActionChains 類提供。ActionChains 類提供的鼠標操作的常用方法:click()click_and_hold()context_click()double_click(

原创 selenium的frame處理

selenium測試的過程中遇到一個問題,就是要先定位左邊的菜單才能定位到右邊的查詢按鈕信息,大概思路就是先切換到左邊的frame點擊“用戶信息”,再切換右邊的frame進行“查詢”操作示例代碼:

原创 jenkins郵件設置

smtp授權碼方法:https://jingyan.baidu.com/article/b0b63dbf1b2ef54a49307054.html

原创 loadrunner11返回驗證

    int HttpRetCode;    int HttpDownloadSize;    int HttpDownloadTime; web_url("q.html",  "URL=http://w

原创 selenium的alert/confirm/prompt處理

prompt/alert/confirm不能直接通過定位工具進行獲取,selenium處理js原生的提示信息prompt/alert/confirm使用switch_to_alert方法切換對象,和frame類似alert\confirm

原创 loadruner常用函數web_get_int_property

通過web_get_int_property判斷http返回狀態碼:Action(){   int HttpRetCode;    int HttpDownloadSize;    int HttpDownloadTime; web_ur

原创 selenium選項處理

下面是待測html源碼:<html><head><meta http-equiv="content-type"content="text/html;charset=utf-8" /><title>單選和複選</title></head><

原创 selenium定位

有多種策略來定位頁面中的元素。你可以使用最適合你的情況。Selenium提供了以下方法來定位頁面中的元素:find_element_by_idfind_element_by_namefind_element_by_xpathfind_el

原创 WebElement常用方法

WebElement  一些常用方法:clear()click()find_element()find_element_by_class_name()find_element_by_css_selector()find_element_b

原创 selenium鍵盤處理

常用鍵盤操作(使用ActionChains的send_keys進行處理):send_keys(Keys.BACK_SPACE) 刪除鍵(BackSpace)send_keys(Keys.SPACE) 空格鍵(Space)send_keys

原创 appium上下文處理

#coding=utf-8 from appium import webdriver desired_caps = {} desired_caps = { 'platformName': 'Android', 'platformVersi

原创 Chrome定位h5頁面

一、官網下載Chrome的adb插件進行安裝,下載的是一個XX.crx的文件,點擊谷歌瀏覽器的拓展程序並將XX.crx的文件拖動進行安裝二、在android端打開Chrome輸入相應網址,同時點擊步驟一圖標,點擊inspect進行頁面元素

原创 selenium操作本地文件報錯

一、手寫一份上傳文件的html腳本並保存到桌面,編寫對應的python代碼進行操作保存如下:查看Python對應的os.path發現os.path.abspath()方法返回的是文件的絕對路徑,也就是說,路徑不對,必須將對應的html文件

原创 selenium的select操作

循環方法處理選項:element = driver.find_element_by_xpath("//select[@name='name']") all_options = element.find_elements_by_tag_na