Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need regular expression for selecting tree view node
#1
Not Solved
Hi
I have a problem in qtp I need help from you.The below statement activates the release(9) node how ever its an acutaldata.Data may change during runtime from 9 to some other digit.how to write regular expression for this.


Code:
DelphiWindow("frmSecurityFunctionsMain").DelphiTreeView("tvFunctions").Activate "x;y;z(9)"
I tried like this
Code:
DelphiWindow("frmSecurityFunctionsMain").DelphiTreeView("tvFunctions").Activate  "x;y;z.*"
but its not working.
Reply
#2
Not Solved
Try this:
1. .Activate "x;y;z/([0-9]/)"
2. if index is constant then you can try:
.Activate 0 ' if its appear first
.Activate 1 ' if its appear second
are you getting right what i am saying right?
Reply
#3
Not Solved
I'm new to QTP and have been doing very well at figuring things out on my own. However, I have a problem I can't figure out and none of the solutions I'm finding and trying are working. Here's my problem:

I have a script which has a Tree View Node which only displays as "_treeview" in the Object Repository. However, I wrote this code to display the child nodes not displaying in the OR:
**************************************
Code:
myNodes = SwfWindow("New Loan").SwfTreeView("_treeView").GetContent

MsgBox myNodes
**************************************
It worked and all the child nodes I was looking for showed up in the MsgBox, including the ones I want to put a Regular Expression On (SEE ATTACHMENT):

Example:
Loan;Contacts;Mister Software Tester;Personal
Loan;Contacts;Mister Software Tester;Employer
etc.

The name (Mister Software Tester) changes on each iteration. Could someone please tell me how to write a Regular Expression to identify this object in the script, eventhough the name (Mister Software Tester) is dynamic. For instance on the next iteration the object name may be:

Loan;Contacts;Misses Tester Lady;Personal
Loan;Contacts;Misses Tester Lady;Personal

Thank you.


Attached Files
.doc   Tree View Nodes.doc (Size: 136.5 KB / Downloads: 118)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to select tree object Chitra 0 1,386 11-19-2018, 04:07 PM
Last Post: Chitra
  Select 'Letter Queue' from Tree View regardless of the number of messages in it. ambica.agarwal@gmail.com 1 1,596 07-05-2018, 05:27 PM
Last Post: Ankur
  Need Any digit in xpath path using Regular expression Priyam 1 3,473 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,342 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,798 03-30-2015, 11:46 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 2 Guest(s)