Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Tree Node - insert a variable

Status
Not open for further replies.

MTek1240

Technical User
Mar 22, 2007
10
0
0
US
Hi All,

I am using QTP 9.2 with Java Application

---
Simple way to select a Java tree subfolder (for example "System") is:

Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select "System"
---

Also,

We may use a variable:

Dim
A = "System"

Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select A
---

If we go in, lets say, "System ==> Users"

That would be:

Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select "System;Users"


But the Question is:

Is there anyway to insert a variable there?

Something like:

Dim
A = System
B = Users

Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select A;B

OR

Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select A;"Users"

Thank you very much!


 
If you concatenate the items together, it's possible:

Code:
Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select A & ";Users"
OR
Browser("Sample").Page("PageSample").JavaApplet("AppletSample").JavaTree("JTree").Select A & ";" & B
This should work for you. Let me know if it doesn't though!

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Thanks alot, Dave!

Yes, that works fine. As simple as that..
I should've known :)

Thanks again!
 
No problem - Happy to be able to help..

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top