Answers for "how can we achive abstraction in java"

0

abstraction example in java

In my framework I have achieved abstraction 
by using collections or Map, because it’s all interface. 
  Most of the cases I come   across using List. 
  If we want to access elements frequently by using index, 
List is a way to go. ArrayList provides faster access if we know index. 
  If we want to store elements and want them to maintain an order, 
List is a better choice. 
i) List webs = driver.getWindowHandles(); 
=>create a list first to store web URLs in list
ii) findElements evaluates multiple elements 
so therefore will assigned to List 
iii) To handle dynamic elements store it in the list and identify by index: 
List all = driver.findElements(By.tagname(“”));
In my framework I follow POM and had situations 
where some pages shared similar actions that were similar 
but worked slightly different, so I was able to use abstraction 
to define those actions and implement them in each page according 
to what was needed for that webpage
Posted by: Guest on May-28-2021

Code answers related to "how can we achive abstraction in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language