solution 1:
dim objwebedit
set objwebedit=browser("oss main page").page("sandy-ver. 27.0 / oss_2").webedit
("name:=os")
objwebedit.set "yangweijun"
inputvalue=objwebedit.getroproperty("value")
****************************************===
solution2:
例子:由於在頁面上有許多webedit, 因此我們需要選擇屬性是」os」的webedit , 在裡輸入文字,並獲取輸入值。
set objdescription=description.create() //使用create方法,建立乙個新的description描述性物件,並賦給乙個新物件
objdescription("type").value="text" //賦屬性值給新物件
objdescription("html tag").value="input"
objdescription("name").value="os"
set objwebedit=browser("oss main page").page("sandy-ver. 27.0 / oss_2").webedit(objdescription) //call 動態webedit物件並賦值給新物件
objwebedit.set "yangweijun"
dim inputvalue
inputvalue=objwebedit.getroproperty("value")
solution3:
例子:回放刪除訂單的指令碼失敗,因為指令碼中的物件已經不存在。雖然訂單核取方塊都是checkbox,但是物件名稱不相同。
使用描述性程式設計的思想是: 設定物件的屬性,判斷滿足條件的物件不為0,隨機選擇乙個刪除,並報告結果
dim objdescription
dim objcheckboxes
dim objcheckboxes_counts
set objdescription = description.create()
objdescription("type").value="checkbox"
objdescription("html tag").value="input"
set objcheckboxes=browser("").page("").childobjects(objdescription)
objcheckboxes_counts=objcheckboxes.count()
if objcheckboxes_counts<>0 then
intrandomindex=randomnumber(0,objcheckboxes_counts-1)
objcheckboxname=objcheckboxes(intrandomindex).getroproperty("name")
objcheckboxes.set "on"
end if
描述性程式設計與物件庫程式設計的對比
專案中一直使用的是描述性程式設計,維護期間的感觸就是描述性程式設計的自動化指令碼維護太費力,如果系統改版就要基本把指令碼全部翻新,我們現在就面臨這個問題。因為還沒換過工作,所以對物件庫程式設計還只是練習,我個人感覺物件庫程式設計的優勢還是很明顯的,一直期望在專案中能真正應用物件庫程式設計方式。個人感...
Pandas物件的描述性統計計算
df pd.dataframe 1.4,np.nan 7.1,4.5 np.nan,np.nan 0.75,1.3 index a b c d columns one two 1.df.idxmax df.idxmin 返回最小值或最大值的索引標籤。df.argmax df.argmin 返回最小值...
index在描述性程式設計中的使用
在需要唯一識別乙個物件時,index屬性有時候可能非常有用。index屬性是物件在源 現的順序,第1次出現時,index值為0。index屬性是object specific的。因此,當你用index屬性值 3 來描述乙個webedit物件時,qtp會在被測程式的當前頁面中查詢第4個webedit物...