0% found this document useful (0 votes)
15 views

Add Object To or by Coding

The document describes how to add an object to an object repository by coding in QTP. It creates a description object, sets property values like class name, HTML tag and inner text. It then checks if the web element exists on the page using the description and reports a pass or fail result. It also answers questions about retrieving text from a list box and webpage and comparing text.

Uploaded by

joscribd2011
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Add Object To or by Coding

The document describes how to add an object to an object repository by coding in QTP. It creates a description object, sets property values like class name, HTML tag and inner text. It then checks if the web element exists on the page using the description and reports a pass or fail result. It also answers questions about retrieving text from a list box and webpage and comparing text.

Uploaded by

joscribd2011
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

How to add a object to object repository by coding Set objDescription = Description.Create() ' -- Creating Object for its description.

objDescription("Class Name").Value = "WebElement" objDescription("html tag").Value = "TD" objDescription("innertext").Value = "Passwords are not consistent. Details" if Browser("New User - Specify").Page("New User Specify").WebElement(objDescription).Exist then Reporter.ReportEvent micFail, "CheckPoint : New User - Specify User Information","Passwords are not consistent." FailCount = 1 Browser("New User - Specify").Page("New User Specify").Image("grafx_gnet_cancel_bu").Click call WriteResultToNotepad(FailCount, "Add a New User") Window("RegExpWndClass:=IEFrame","index:=0").Close qtApp.Test.Close else Reporter.ReportEvent micPass, "CheckPoint : New User - Specify User Information","Passwords are consistent." End if 1 . i have to retrive the text from the list box in the Web page and put it into datasheet . 2 I have to retrive the text placed at some place in the web page and compare it with another text . i tried using outputcheckpoints-- text , but its not working 1)For your first question, use output value and the property which stores all the values of the list box.Dim ABrowser("Desktop One").Page("Desktop One").Frame("searchAreaIFrame").Link("SUNG,ANDREW").Output CheckPoint("SUNG,ANDREW")Total = DataTable("SUNG_ANDREW_href_out",dtLocalSheet) msgbox(A)So A will contain the values of the list box.2) Do u want to capture a text and search whet the same text is present in the other pages or wht do u mean you want to compare?

You might also like