OOPS concepts:-[object oriented program]
It is having below concepts
1) class & objects
2) encapsulation
3) inheritance
4) polymorphism
5) abstraction
These are requested table concepts.
How to develop scripts to a project:-
Package –project-Spicejet
Class - module -book a flight
Class -reasonable methods –objects (I,e url,login,logout)
Inheritance:
The process of extending [reversing]the public objects from the parent class to child class is known as “inheritance”.
From, where we are taking the public objects, is known as parent class or super class.
where we are going to use the public objects is known as child class.
At TekSlate, we offer resources that help you in learning various IT courses. We avail bothwritten material and demo video tutorials.
To gain in-depth knowledge and be on par with practical experience,
then explore Selenium Training in Bangalore.
** write a program to back a holiday in spicejet .com by inheriting the parent class spicejet.popup.
Public class bookaholisday.inheritence extends spicejet-popup {
@test
Public void verifyholiday() throws exception {
Driver .find elements(by.linktext(“holiday”).click();
New select[driver .findelements(by.id(“destination id”))).selectvisibletest(“id”);
}
Thread.sleep(4000);
Driver.find element(by.xpath(“//input[@id=’locator id’]”)).click();
Driver .find element( “” [2] “)).click();
“ “; “ [3])).click();
}
} polymorphism:-
The ability to define more methods with the same name is known as polymorphism.
It is two types
1) overloading
2) overriding
1) over loading:-
It occurs when more methods with the same name but with different parameters is known as overloading
Public void click(string str) {
Driver .findelements(by.linktext(str)).click();
}
Public void click (string str, string str1) {
Driver.find elements(by.linktest(str)).click();
Driver.findelements(by.linktest(str1).click();
}
Public static void main(string [] args) {
Google languages
g.open URL c;
g.click(“Hindi”,”English”);
g.click(“Gmail”);
Login into gmail.com by inheriting the class Google languages parameter and override the method click
Learn more about Selenium Interview Questions in this blog post.
2) overriding:-
It occurs when we inherit parent class
àIf we are using the method is behaving in two ways in child class one way was as in parent class in another way
Encapsulation:-
Abstraction:-
Inclined to build a Profession as Selenium Developer?
Enroll here for Free Demo on Selenium Training In Dallas.
Assignment:
A Object Open URL Login Log out | B Compile Upload Send mail | C Register Print text box Print drop down |
RUN:
Open URL Login compare send log out clone Register print next box
You liked the article?
Like: 1
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.