LeanFT

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

Categories: LeanFT

Tagged as: , , , ,

7 replies »

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