Professional Documents
Culture Documents
ABSTRACTION
In Page Object Model design pattern, we write locators (such as id, name, xpath etc.,) in a Page
Class. We utilize these locators in tests but we can’t see these locators in the tests. Literally we
hide the locators from the tests.Abstraction is the methodology of hiding th implementation of
internal details and showing the functionality to the users.
INTERFACE
WebDriver itself is an Interface. So based on the above statement WebDriver driver = new
FirefoxDriver(); we are initializing Firefox browser using Selenium WebDriver. It means we are
creating a reference variable (driver) of the interface (WebDriver) and creating an Object. Here
WebDriver is an Interface as mentioned earlier and FirefoxDriver is a class.
An interface in Java looks similar to a class but both the interface and class are two different
concepts. An interface can have methods and variables just like the class but the methods
declared in interface are by default abstract. We can achieve 100% abstraction and multiple
inheritance in Java with Interface.
INHERITANCE
We create a Base Class in the Framework to initialize WebDriver interface, WebDriver waits,
Property files, Excels, etc., in the Base Class.
We extend the Base Class in other classes such as Tests and Utility Class. Extending one class
into other class is known as Inheritance.
POLYMORPHISM
METHOD OVERLOADING
We use implicit wait in Selenium. Implicit wait is an example of overloading. In Implicit wait we
use different time stamps such as SECONDS, MINUTES, HOURS etc.,
What I Was Looking For
Before I set out on my journey, I wrote down 3 really crucial points that I would judge the
libraries on. These aren’t too complex or even that much of an ask (Or so I hoped).
Price
Obviously free is ideal. Something open source that I can debug myself is even better. But if I do
have to pay for a “premium” library. I’m looking for a one time fee that isn’t some stupid “per
user/seat/machine/server” model. If I’m looking at this library as a company, I don’t want future
architecture or decisions to be made based on the pricing of a library.
If there is some sort of freemium model in play, then I also wanted to make sure that the
limitations weren’t too crazy (e.g. single pages only, set number of images allowed per PDF).
Freemium is OK as long as the free version is actually useable.
PDF Sharp
First up is PDF Sharp, I feel like I’ve used this one previously but I’m not entirely sure. The
whole ____Sharp thing was all the rage in the early days of C#. Anyway straight off the
bat PDFSharp does not work with .NET Core. There may be ported versions floating around
but the version on Nuget does not support .NET Core. So it’s pretty much dead in the water. But
this one was suggested to me over and over so I still want to do a quick write up about it.
Price
PDF Sharp is free and open source. They do offer paid support but don’t give any specifics on
how this works and how much it costs. Free is free though so you can’t complain too much.
HTML Templating
Oh boy. HTML Templating doesn’t make it into the PDF Sharp library unfortunately. Instead we
are stuck with writing syntax like we are back in the GDI+ dark days of C# :
// Create a font
I get it that this was what you had to do in the year 2000, but it’s just not going to fly right now.
There are ways around this using another library that extends PDFSharp… But that’s still
another library that you have to grab and work with. So basically, in terms of a decent template
engine out of the box, it’s a fail.
Ease Of Use
Well. It doesn’t work with .NET Core which is probably going to be a blocker. The last
published version was 2013. And it doesn’t have HTML rendering packaged (And the library
that currently does extend it to do HTML templating also doesn’t support .NET Core). So all in
all. Forget about it.