Writing a simple code using Fluentlenium for Selenium Java

In the last post we disscused how to write a 5s code with Fluentlenium for Selenium Java.

In this post, we will be writing code further more for some other controls like:

  • naviagte to url
  • click button
  • fill in a text box
  • getText in web element

Here is the complete code for above:

 public void bmi_calculator(){
 // Navigate to bmi calculator page
 //Click Metric tab
 find(By.xpath(".//a[.='Metric Units']")).click();
 // fill in age 
 // select gender
 // fill in height
 // fill in weight
 //click calculate button
 // print out the result

and here is outupt console:


BMI = 25.69 kg/m2 (Overweight)
Normal BMI range: 18.5kg/m2 - 25 kg/m2
Normal BMI weight range for the height: 54.7kgs - 74.0 kgs
Ponderal Index: 14.94 kg/m3



Thanks for reading the post !!!

Please leave your comments and let me know if there is anything I should update in this post.

Ha Do

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.