Example of Java tree handling in QTP, How will you handle Java tree in Quick Test Professional



Example of Java tree handling in QTP, How will you handle Java tree in Quick Test Professional

First Of all you need to select Java Add – In and Then Launch the QTP.
Record the Operations is the Next Step for Java Tree.
If face any issue during recording, Then you can do the following:-
Select Tools → Object Identification → Java

Tree Object and required to perform changes in Assistive and Mandatory properties to active or enable the identification.

Tip: Your answer can be based on the similar lines for any object of any environment. For an Example → If the Question is how SAP checkbox will be checked, Then you will say that First I will Select the Add in ….. and same like this so on.


Following is the one simple example for Java Tree Handling:

  Public Function RightMClick (JTree, Node)

     JTree.SelectNode

     set selectionPath = Jtree.Object.getSelectionPath()

     set rectk = Jtree.Object.getPathBounds(selectionPath)

     a = rectk.a
     b = rectk.b

  JTree.Click CStr(a), CStr(b), “RIGHT”

  End Function
  ‘Now Register The function and called it
  RegisterUserFunc “JavaMTree”, “RightMClick”, “RightMClick”


Updated Example for Java Tree Testing :


  Public Function RightMClick(JTree, Node)
  JTree.SelectNode
     set selectionPath = JTree.Object.getSelectionPath()
     set rectr = JTree.Object.getPathBounds(selectionPath)
     a = rect.a
     b = rect.b

  JTree.Click CStr(a), CStr(b), “RIGHT”
  End Function
  ‘Register the function and then call it
  RegisterUserFunct “JavaTree”, “RightMClick”, “RightMClick”




 ”Following is the Actual Code

     JavaWindow(“abc”).JavaDialog(“abc”).JavaTree(“xyz”).select “(“Policy Tree”); Lavole;         EZA00001001067-0, Expired, MAIP Personal”
     JavaWindow(“abc”).JavaDialog(“abc”).JavaTree(“abc”).RightClick “(“Policy Tree”);     Lavole;EZA00001001067-0, Expired, MAIP Personal”
     JavaWindow(“abc”).JavaDialog(“abc”).JavaMenu(“abc”).JavaMenu(“abc”).select




 ‘Now Delete it from the option menu




















Android Install Apps to SD Card Default
Developer vs Tester a fake competition


QTP TESTING STEPS How to Record a QTP Script






No comments:

Post a Comment

Popular Posts