MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Introduction to OOP’S Concept in Selenium

Published on 06 December 18
0
0

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:

Introduction to OOP’S Concept in Selenium - Image 1The process of extending [reversing]the public objects from the parent class to child class is known as “inheritance”.

Introduction to OOP’S Concept in Selenium - Image 2From, where we are taking the public objects, is known as parent class or super class.

Introduction to OOP’S Concept in Selenium - Image 3where 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 both written 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:-

Introduction to OOP’S Concept in Selenium - Image 4The ability to define more methods with the same name is known as polymorphism.

Introduction to OOP’S Concept in Selenium - Image 5It is two types

1) overloading

2) overriding

1) over loading:-

Introduction to OOP’S Concept in Selenium - Image 6It 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 (srting 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”);

Introduction to OOP’S Concept in Selenium - Image 7Login 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

  • The updations which we made to the child class method is limited to child class only.
  • The memory authorization in proper [same the memory] with over loading and over rising

Encapsulation:-

  • The process of holding that operates into a single entity.

Abstraction:-

  • The process of word hiding the data and show the accesseential features of the object is known as abstraction.
  • We can achieve abstraction by using access modifier by
  • Public, protected can be used in child class only.
  • Public can be used in child class as well as they’re in the entire project by creating the object.
  • Private objects can be used in the current class only
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 Introduction to OOP’S Concept in Selenium - Image 8 Login Introduction to OOP’S Concept in Selenium - Image 9 compare Introduction to OOP’S Concept in Selenium - Image 10 send Introduction to OOP’S Concept in Selenium - Image 11 log outIntroduction to OOP’S Concept in Selenium - Image 12 clone Introduction to OOP’S Concept in Selenium - Image 13 Register Introduction to OOP’S Concept in Selenium - Image 14

print next box

Source: https://tekslate.com

This blog is listed under Quality Assurance & Testing Community

Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top