获取input内容并回填_超详细的软件测试内容实战
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                获取input内容并回填_超详细的软件测试内容实战
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                作者:Arnold
鏈接:
軟件測試面試?zhuanlan.zhihu.com來源:知乎
很多人都拿到了不同的學習軟件測試學習路線圖,但是卻不知道其實軟件測試更多的需要實戰。談到實戰,我的發言比較具有權威性,很簡單,實戰的結果以什么維度去考慮,是不是需要對應的輸出件。
阿里的名言:沒有結果的努力全是瞎忙!!!
那么我們來分析下,軟件測試的過程中,或者學習的過程中都需要輸出哪些內容?第一階段,熟悉軟件測試中的各個軟件測試術語的相關概念。第二階段,輸出對應的軟件測試方法及分類第三階段,軟件測試的相關模型。第四階段,輸出軟件測試生命周期第五階段,需求評審,企業的第一個會議第六個階段,測試用例的輸出第七個階段:Linux相關命令第八個階段:數據庫的相關練習一、where子句練習
1.查找滿足價格大于等于9的所有信息;2.查找滿足product_id在1002和1003之間的;3.查找user_id在1、3、5這三個數內的信息;4.查找訂單狀態是已支付的信息;5.查找用戶名類似于li開頭的信息;6.查找用戶名中第二個字母是h的信息;7.查找用戶名中第二個字母不是h的信息;8.查找用戶名中最后一個字母不是以i結尾的信息;9.查找價格大于8,且訂單狀態是已支付的信息;10.查找用戶表中user_nick為null的信息;11.查找用戶表中user_nick不為null的信息。二、聚合函數練習
1.查找訂單表中最大的價格;查找訂單表中最小的價格;2.查找訂單表中user_id=2的最小價格;3.分別列出訂單表中user_id=2的最小價格和最大價格;4.分別列出訂單表中user_id=2的最小價格和最大價格,并把最小價格的展示結果的列名改為“min_price”;5.求訂單表的價格的平均值,求訂單表中user_id=2的價格的平均值;6.分別列出訂單表中user_id=2的價格的平均值、最小值、最大值;7.求訂單表中user_id=1的價格的總和;8.求訂單表中user_id=1或者user_id=3的價格總和;第九個階段:探索式測試第十階段:Python相關實戰1.提醒用戶輸入自己的英文名字,然后保存到字典中(以name為key),將用戶輸入的英文名字翻轉,繼續保存到剛才的字典中(以new_name為key)將字典中用戶的正常的英文姓名賦值給變量real_name,告知客戶“您的英文名字是:” + 變量,“您的英文名字翻轉是:” + 字典里獲取;
dict_user={} real_name=input('請輸入你的英文名字:') dict_user['name']=real_name dict_user['new_name']=real_name[::-1] print("你的英文名字是:"+real_name,"你的英文名字翻轉是:"+dict_user['new_name'])2.提醒用戶依次輸入數學、語文、英語、綜合四門的成績,按照輸入的成績排序,告訴用戶“您的最高的一門成績是:”xx (不用告訴用戶是哪一科)1)方法一:
score=[float(input('請輸入你的數學成績:')),float(input('請輸入你的語文成績:')),float(input('請輸入你的英文成績:')),float(input('請輸入你的綜合成績:'))] sorted_score=sorted(score,reverse=True) print('你的最高一門成績是:%d'%sorted_score[0])2)方法二:
subjects=['數學','語文','英語','綜合'] score=[] for subject in(subjects): single_score=float(input('請輸入你的%s成績:' %subject)) while single_score>100 or single_score<0: single_score=float(input('輸入錯誤,請重新輸入你的%s成績:' %subject)) score.append(single_score) sorted_score=sorted(score,reverse=True) print('你的最高一門成績是:%d' %sorted_score[0])3)方法三:
subjects=['數學','語文','英語','綜合'] dict_score={} for subject in(subjects): score=(float(input('請輸入你的%s成績:' %subject))) while score>100 or score<0: score=float(input('輸入有誤,請重新輸入你的%s成績:'%subject)) dict_score['%s' %subject]=score max_score=max(zip(dict_score.values())) print('你最高一門的成績是:%s' %max_score)3.使用input讓用戶依次輸入兩個數字, 計算兩個數字的和并顯示。
a=float(input('請輸入第一個數字:')) b=float(input('請輸入第二個數字:')) print('兩個數字之和是:%s' %(a+b))1.用python輸出九九乘法表
for i in range(1,10): for j in range(1,i+1): print('%dx%d=%d ' %(j,i,j*i),end='') print()2.猜數字游戲
代碼中生成一個隨機整數,然后用戶輸入數字后,程序提示用戶的輸入是高了還是低了,直到用戶猜中這個數字, 游戲結束。
import random a=random.randint(0,100) b=int(input('請輸入你猜的數字:')) while b!=a: if b>a: b=int(input('你猜高了,請重新猜這個數字:')) else: b=int(input('你猜低了,請重新猜這個數字:')) else: print('你猜對了,游戲結束')第十二階段:自動化測試from selenium import webdriver #從selenium導入webdriver這個類import time
driver = webdriver.Chrome() #初始化一個driver對象
driver.get(' http://101.133.169.100/yuns/')
time.sleep(5)#xpath絕對路徑#登錄
driver.find_element_by_xpath('/html/body/div[1]/div/div[1]/a[1]').click()#免費注冊
driver.find_element_by_xpath('/html/body/div/div/div[1]/a[2]').click()#全場免運費
driver.find_element_by_xpath('/html/body/div/div/div[2]/span[1]').click()#優惠券
driver.find_element_by_xpath('/html/body/div[3]/div/div/a[3]').click()#我的訂單搜索框
driver.find_element_by_xpath('/html/body/div/div/div/form/div/div/input[1]').send_keys('男鞋')#xpath相對路徑#登錄
driver.find_element_by_xpath("//div[@class='login']/a[1]").click()
driver.find_element_by_xpath("//*[@class='login']/a[1]").click()#更好留給你
driver.find_element_by_xpath("//div[@class='schhot']/a[6]").click()
driver.find_element_by_xpath("//a[contains(@title,'更好')]").click()
driver.find_element_by_xpath("//*[@class='schhot']").click()
driver.find_element_by_xpath("//a[@title='更好留給你']").click()#我的訂單搜索框
driver.find_element_by_xpath("//div[@class='sch']/input[1]").send_keys('男鞋')
driver.find_element_by_xpath("//*[@class='sch']/input[1]").send_keys('男鞋')
driver.find_element_by_xpath("//input[@class='text' and @type='text']").send_keys('男鞋')
driver.find_element_by_xpath("//input[contains(@name,'key')]").send_keys('男鞋')#服務時間
driver.find_element_by_xpath("//div[@class='contact_us']/p[3]").click()
driver.find_element_by_xpath("//*[@class='contact_us']/p[3]").click()
driver.find_element_by_xpath("//p[@class='service']").click()
driver.find_element_by_xpath("//p[contains(@class,'serv')]").click()#個人頭像
driver.find_element_by_xpath("//div[@class='img']/img").click()
driver.find_element_by_xpath("//*[@class='img']/img").click()
driver.find_element_by_xpath("//img[@width='80']").click()
driver.find_element_by_xpath("//img[contains(@src,'/yuns/')]").click()#css定位#首頁輸入框
driver.find_element_by_css_selector("html body div div div div form input:nth-child(1)").send_keys('襯衫')#購物車
driver.find_element_by_css_selector("div.small_cart_name>span").click()#首頁輸入框
driver.find_element_by_css_selector("input.but1").send_keys('襯衫')#我的訂單搜索按鈕
driver.find_element_by_css_selector("input[type='submit']").click()#在線支付
driver.find_element_by_css_selector("div.contact_help>dl:nth-child(4)>dd:nth-child(2)>a").click()#我的購物車數字圖標
driver.find_element_by_css_selector("i#cart_num").click()#會員中心
driver.find_element_by_css_selector('div[class="con"]>p>a:nth-child(1)').click()#整點秒殺按鈕
driver.find_element_by_css_selector('a[target="_blank"][href="http://101.133.169.100/yuns/index.php/goods/seckill"]').click()獲取驗證信息from selenium import webdriver #從selenium導入webdriver這個類import time
driver = webdriver.Chrome() #初始化一個driver對象
driver.get(' http://101.133.169.100/yuns/')
time.sleep(5)
title = driver.title #獲取頁面title信息
print(title)
driver.find_element_by_link_text('口紅').click()
url = driver.current_url #點擊某一按鈕之后,獲取當前頁面信息的url
print(url)控制瀏覽器
from selenium import webdriver #從selenium導入webdriver這個類
import time
driver = webdriver.Chrome() #初始化一個driver對象
driver.get(' http://101.133.169.100/yuns/')
time.sleep(5)
driver.find_element_by_link_text('口紅').click()
driver.refresh() #瀏覽器刷新
time.sleep(2)
driver.back() #瀏覽器回退
time.sleep(2)
driver.forward() #瀏覽器前進
time.sleep()設置瀏覽器尺寸
from selenium import webdriver #從selenium導入webdriver這個類 import time driver = webdriver.Chrome() #初始化一個driver對象 driver.get(' http://101.133.169.100/yuns/') time.sleep(5) driver.maximize_window() #瀏覽器窗口最大化 time.sleep(2) driver.set_window_size(1200,800) #設置瀏覽器的高和寬 time.sleep(2)動作方法
from selenium import webdriver #從selenium導入webdriver這個類 import time driver = webdriver.Chrome() #初始化一個driver對象 driver.get(' http://101.133.169.100/yuns/') time.sleep(5) driver.find_element_by_name('key').send_keys('口紅') #輸入內容,只針對輸入框 time.sleep(2) driver.find_element_by_name('key').clear() #清空輸入框的內容 time.sleep(2) driver.find_element_by_id('cart_num').click() #點擊控件窗口切換
from selenium import webdriver #從selenium導入webdriver這個類 import time driver = webdriver.Chrome() #初始化一個driver對象 driver.get('http://www.baidu.com') time.sleep(5) driver.find_element_by_class_name('s_ipt').send_keys('騰訊視頻') driver.find_element_by_id('su').click() print(driver.window_handles) #獲取當前窗口所有信息 driver.find_element_by_xpath("//div[@id='1']/h3/a[1]").click() print(driver.window_handles) print(driver.current_window_handle)# 獲取當前焦點所在的窗體 driver.switch_to.window(driver.window_handles[1]) #切換窗體的焦點 driver.close() #關閉當前焦點所在的窗體 driver.quit() #關閉所有窗體
自動化測試報告第十三階段:移動端自動化第十四階段:接口測試性能測試第十五階段:接口自動化測試
總結
以上是生活随笔為你收集整理的获取input内容并回填_超详细的软件测试内容实战的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 不去银行怎么更新身份证信息
- 下一篇: VISA卡怎么办理 需要VISA卡的申请
