Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
665 views
by Contributing Tester (12 points)
retagged by
Hi All,

Where & how would you make use of encapsulation concept of java in your automation project.

Please provide an example.

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)

Encapsulation in java is a process of wrapping code and data together into a single unit. The most commonly used real world example for a selenium java framework would be the page classes, where we should declare our WebElement/By objects as private and employ getter/setters  to be public so that the private members can be accessed from outside the page class. This , as turns out binds the data ( private elements) and code( public getter methods) into one single unit for the class.

Explained by Shubham Shukla (https://www.linkedin.com/in/shubham-shukla-254b81a5/)


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...