QTP Automated Test Training: Describing the webelement of programming

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.