Descriptive programming techniques are described to describe the input box: Set Po=browser ("Creationtime:=0"). Page ("Micclass:=page") set Desc=description.creatre () Odesc (" Micclass "). Value=" Webedit "Odesc (" HTML Tag "). Value=" Input "... HTML tag in HTML input box in addition to input in fact there are textarea, etc.
<textarea rows= "3" cols= ">" Content ..... Content </textarea>
The Description Item property supports regular expressions, and the default switch opens
Odesc. Item.regularexpression=trueTherefore, it can be modified to: Odesc ("Micclass"). Value= "Webedit" Odesc. Item.regularexpression=trueodesc ("HTML Tag"). Value= "Input|textarea", which supports the form of input and Testarea two text boxes but in some JS frames, The input box tag does not have these, may be the Div, and uses QTP to identify is webelement, but is not webedit, we know, Webedit and webelement belong to the inheritance relation, can modify to such set desc= Description.creatre () ' Odesc. Item.regularexpression=trueodesc ("Micclass"). Value= "Webelement" Odesc ("HTML Tag"). Value= "Input|textarea|div" full script ' text box input function SendKeys (propertyname,propertyvalue,value) Set Po=browser ("Creationtime:=0"). Page ("Micclass:=page" ) ' Po can also be written as a method of parameter set Desc=description.creatre ()
Odesc ("Micclass"). Value= "Webelement"
odesc ("HTML Tag"). Value= "Input|textarea|div"' Put all the tag tags you need in Odesc (PropertyName). Value=propertyvalue set Child=po.childobject (odesc) ochild (0). Set Valu E ' multiple elements, index can also be used as the parameter end function in this way, only need to encapsulate the operation type, and for the type of the element can be replaced with webelement, and then the HTML tag uses the regular expression symbol "|" To match one of the calls of any tag: Call SendKeys ("XPath", "//input[@name = ' username ']", "test001") can be seen, all page elements, Its micclass can actually be written in webelement. If QTP cannot identify the
WebElements that can be helped by other assistive tools to identify
QTP Automated Test Training: Describing the webelement of programming