LeanFT Java Tutorial Part 5 – Finding Child Objects

If you have worked with UFT/QTP, you must be pretty familiar with the ChildObjects method but in case you have not, this method is used to find a collection of objects that match a given set of description properties.

For example, if you google “leanft tutorial”, and you want to find out how many links are redirecting to this blog, you will have to write code in the following way:-


 LinkDescription targetLinks = new LinkDescription.Builder()
 .href(new RegExpProperty(".*learn2automate.*")).tagName("A").build();
 
 Link[] myBlogLinks = browser.findChildren(Link.class, targetLinks);
 
 Assert.assertTrue("There should be atlease 1 Link present", myBlogLinks.length>0);
 

So here the ChildObjects method(from UFT) is replaced by the FindChildren method and the logic more or less remains the same.

Please comment if you face any issues while executing this.

LeanFT Java Tutorial Part 6 – Parameterizing Tests

Happy Automating!
Harshit Kohli

Advertisements

Eat, Sleep, Automate. REPEAT !

Tagged with: , , , ,
Posted in LeanFT
5 comments on “LeanFT Java Tutorial Part 5 – Finding Child Objects
  1. Ranjan says:

    do you have any updated tutorial in uft pro14 (LeanFT14)

  2. Smita says:

    How to work with frames/iframes in leanft using java?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Stats
  • 168,130 hits
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 796 other followers

%d bloggers like this: