Selenium installation
Step1: Create a new java project (Create module & dont create module--->Select
don't create module)
step2: Download selenium jar file.
step3: Configure selenium jar file into our selenium project.
1. right click on project
2. select build path
3. slect configure build path
4. click on Libraries tab.
5. click on Add external jars.
5. browse selenium jar file.
6. Apply
7. Apply & close
note:
--if add external jar file is disabled--
Class path & module path ---> select class path option
Step4: download [Link] file
pre-condition: check current chrome browser version
1. unzip downloaded [Link] file
-----------------
1st selenium program: open browser
step1: set [Link] file path by using [Link](parameter1,
marameter2) method
parameter1- name of browser (small letter)
parameter2- path of browser (convert \ to \\)
Step2: Create an object of ChromeDriver class
note: sessionNotCreated exception--> browser version mismatch -->download
lower/upper version [Link] file
url checker timeout exception--> need to format your PC/Laptop:
-----------------------------------------------------------
Webdriver:
It is an interface use to perform action of browser.
1. get- to enter url in browser or to open an application.
2. close: to close the current tab of the browser.
3. quit: to close the all the tabs present in browser
4. maximize - use to maximize the browser
5. minimize - use to minimize the browser
6. navigate: this method is use to open an application, move forward, backward &
refresh the webpage.
7. getTitle: this method is use to get title of a webpage. return type of getTitle
method is String
8. getCurrentURL: this method is use to get URL of a webpage. return type of
getCurrentURL method is String
setsite()
setposition()
----------------------------------------------------
Locator:
Types of locator
1. Tagname -->tagname
2. id -->attribute value
3. name -->attribute value
4. classname -->attribute value
5. linkText -->text
6. partial LinkText -->text
7. css -->xpressions
8. xpath ** -->xpressions
------------xpath---------
Xpath expression
1. xpath by attribute - //tagname[@attributeName='attribute value']
2. xpath by text - //tagname[text()='text value']
3. xpath by contains
1. xpath by contains with text - //tagname[contains(text(),'text value')]
2. xpath by contains with attribute - //tagname[contains(@
attributeName,'attribute value')]
4. xpath by index - (xpath xpression)[index]
5. Absolute xpath
6. Relative Xpath
Absolute xpath:
UN: /html/body/div[1]/input[1]
contact: /html/body/div[2]/input[3]
login: /html/body/div[3]/button
Relative Xpath:
UN: //div[1]/input[1] or //div[1]//input[1]
contact://div[2]/input[3] or //div[2]//input[3]
login: //button
--------------------------------------------------------
WebElement: it is an interface use to perform action on element present in a
browser.
Webelement methods:
1. Sendkeys():
This method is use to enter value in the input/text field
2. Clear():
This method is use to clear value in the text field.
3. Click():
Click method is use to click on buttons, links also use to select radio
buttons & checkboxes.
4. getText:
This method is use to get text present in a webpage.
Return type of getText function is String.
5. isEnabled():
This method is use to verify element is enabled or disabled.
Return type of isenabled function boolean
if element is enabled then it returns true otherwise it returns false.
6. isDisplayed():
This method is use to verify element is present or not.
Return type of isDisplayed function is boolean.
if element is present then it returns true otherwise it returns false.
7. isSelected():
This method is use to verify radio button/checkbox is selected or not.
Return type of isSelected function is boolean.
if radio button/checkbox is selected then it returns true otherwise it
returns false.
-----------------------------------------------------------------------------------
--------------------
Section-2
Listbox:
----------------------------------------------------------------------------
Popups:
Popups are small or seperate window which will be displayed when we perform
action on any componants present in a webpage.
These popus can be handled by selenium directly, but sometimes we may need to
use 3rd party tools to handle these popups.
Types of popups:
1. Hidden-Division Popup
*2. Alert popup
*3. Child browser Popup
4. Authentication Popup
5. File Upload Popup
6. File Download Popup
If we are able to inspect element present in a popup then we can use selenium
directly to handle that popup.
If we are unable to inspect element present in a popup then we need to use
3rd party tool to handle that popup.
1. Hidden-Division Popup:
1. These popups are colourfull.
2. We can inspect the elements present in pop up.
3. As we can inspect element present in popup then using selenium we can
handle it & no need to switch.
4. URL: [Link]
eg. popup on flipkart
2. Alert/Confirmation Popup:
1. We cannot inspect the elements present in pop up.
2. These popup will contain ok button or cancel button & Text.
3. Sometimes these type of popup also contains ? or ! symbol.
4. url: [Link]
------Procedure to handle Alert popup--------
1. To handle alert popup we need to switch selenium focus from main page to
alert popup by using syntax
Alert alt = [Link]().alert();
2. Alert is an interface which contains abstract methods like:
1. accept(): use to click on ok button.
2. dismiss(): use to click on cancel button.
3. getText(): use to get text present present in a alert popup.
--> To click on OK button
[Link]();
--> To click on Cancel button
[Link]();
--> To get the text present in a webpage:
String text = [Link]();
3. Child browser Popup/window popup
[Link] can inspect elememt present in popup.
[Link] popup will contain address field(url),maximize,minimize and close
options.
[Link]: [Link]
-----Procedure to handle Child browser popup-------
1. To handle Child browser popup we need to switch selenium focus from main
page to Child browser popup by using syntax
[Link]().window("String ChildwindowId")
2. To get address of main page as well child browser we need to use synatx
set<String> IdOfMainPage=[Link]();
return type of getWindowHandles method is set<String>
3. To get address of only main page we need to use syntax
String IdOfMainPage=[Link]();
return type of getWindowHandle method is String
4. To get address of child browser we need to use synatx
Set<String> ids = [Link]();
ArrayList al=new ArrayList(ids);
[Link]([Link](0)); // address of main page
[Link]([Link](1)); // address of child browse
4. Authentication Popup--autoIT tool / Robot class
1. Pop up displayed on Page load
2. We cannot inspect the elements present in pop up.
4. URL: [Link]
5. file upload--autoIT tool/ Robot class
6. file download--autoIT tool/ Robot classs
--------------------------------------------------------
Diffrent Types of Exceptions in Selenium:
1. Webdriver Exception
-------------------------------------------------------
Iframe
diffrent ways to switch from main page to iframe
1. Frame id - String
2. Frame name - String
3. Frame webelement -WebElement
4. Frame index - int
diffrent ways to switch from Iframe to main page
1. parentFrame()
2. defaultContent()
--------------------------------------------------
WebTable
-------------------------------------------------
Action class: [Link]
-Handling of DropDown
Step1: Idendify dropdown element
step2: Create an object of Actions class with webdriver object as a input
step3: Call Actions class methods--> moveToElement
-Action class methods
1. moveToElement
2. contextClick --> To perform mouse right click action
3. perform -- To execute each statement/action
4. build -To combile multiple actions in a single statement
5. click
6. doubleclick
7. dragAndDrop
8. clickAndHold
9. release
URLs: [Link]
dragAndDrop : [Link]
doubLeClcik : [Link]
other: [Link]
--------------------------------
Handling Custimized Listbox
Action & keys class
----------------------------------------
Scroll/Updown
What is a Scrollbar?
A Scrollbar is a lets you move around screen in horizontal or vertical direction if
the current page scroll does not fit the visible area of the screen.
It is used to move the window up and down.
Selenium Webdriver does not require scroll to perform actions as it manipulates
DOM.
But in certain web pages, elements only become visible once the user have scrolled
to them. In such cases scrolling may be necessary.
Scroll bar is of two type : Horizontal and vertical scroll bar as shown in below
screenshot.
------------------------------------
UN: TR3583
PWD: Bhavi@2406
Pin: 240621
What is Selenium Framework? Types of Framework?
The Selenium Framework is a code structure that makes code maintenance easy
and efficient.
Without frameworks, users may place the “code” and “data” at the same
location which is neither reusable nor readable.
Frameworks produce beneficial outcomes like increased code reusability,
higher portability,
reduced cost of script maintenance, better code readability, etc.
There are mainly three type of frameworks created by Selenium WebDriver to
automate manual test cases
1. Data Driven
2. Keyword Driven
3. Hybrid
1. Data Driven
Data Driven Framework in Selenium is a method of separating Test data from
the test case.
Once the Test data are separated from the test case, it can be easily
modified for a specific functionality without changing the code.
It is used to fetch Test Data from external files like Excel, .csv, .xml or
some database tables.
1. example without DDF
2. example with DDF
------------------------------------
Encapsulation concept:
Hiding data from other classes using private access specifier is called
encapsulation
1. Data member/variable should be declared globaly with access level
private
2. Initialize within a constructor with access level public
3. Utilize within a method with access level public
---------------------------------------------------------
THM944
Bisen@7566
812073
POM with pagefactory
POM(page object module):
IT is a java design pattern use for design of classes in Test script.
Page Object model is an object design pattern in Selenium, where
1. Web pages are represented as pom classes &
2. The various elements on the webpage are defined as variables on the
pom class.
In this case we will use Page Factory to initialize web elements that are
defined in web page classes or Page Objects.
POM Strictly follows encapsulation concept where
1. Data member should be declared globaly with access level private
using @findBy Annotation
2. Initialize within a constructor with access level public using
pagefactory class
3. Utilize within a method with access level public
Note:
1. No of D.M. that need to be created under a pom class will depends on
no of element that need to be handle in a webpage.
2. pom class will not contain a main method, to run a pom class we
require another class with main() ie. Test class
3. Test class will contain all the navigation steps to test an
application
Pagefactory:
It is a class which contains static method like initElements.
To initialize global variable in PageFactory we need to use initElements
method within the constructor.
Syntax:
[Link](driver, this);
initElements will initialize D.M by identifying each componant present in a
webpage by using @findBy annotation,
which takes locator type as an input.
Syntax:
@FindBy(locator Type ="locator value/exression")
private WebElement D.M. ;
Working of PageFactory:
1. While executing Test Script initElement method will convert all the the
data members @findBy annotation to findElement(),
this process is known as basic/early initialization.-->after creating
object of pom class
@FindBy(xpath="//span[text()='KV']") private WebElement PN;
----> private WebElement PN =
[Link]([Link]("//span[text()='KV']"));
2. To perform action on component we need to call a methods.
3. Before performing each action initElement method will identifies component
present or not,
then it will do complete initialization
this process is known as late/lazy initialization. ---->after method call
Disadvantage of simple POM:
simple POM will initialize all the component before performing actions(after
object creation),
but sometimes application may contains few components which will be hidden &
displayed once we perform action on other components, that hidden component
will not be displayed while pom initializing,
so it throws "No such element" exception.
To overcome drawback of simple pom, we need to use "PageFactory" which is an
extension of pom.
Diffrence between POM & PageFactory
simple POM Pom
with PageFactory
1. It will initialize/identify all the D.M. present in It
will initialize/identify the D.M. present in a class before
class completely before performing action on components performing
each action.
2. It will use if webpage is not containing hidden elements. It
will be used if webpage is containing hidden elements.
Advantages of POM:
1) Makes the code reusable
2) It is useful in reducing code duplication
3) It makes ease in maintaining the code (flow in the UI is separated from
verification)-->TestNG
4) Makes code readable (Methods get more realistic names)
5) The Code becomes less and optimised
Pom class:
1. Pom class depends on webpage present in an application.
2. For each webpage pom class will be created, no of POM class depends on no
of webpages present in an apllication.
3. In each POM class D.M./variable are created in encapsulation concept by
using pagefactory.
4. No of D.M. created in POM class will depend on no of elements present in a
webpage.
5. each declared D.M. should initialized & utilized in POM class.
Test class:
1. Test class depends on no of Test cases written by manual Test engineer.
2. Test class will contains navigation steps & inputs that need to be given
to the components/elements.
3. In test class data/inputs that can be given directly or through external
source like Excel sheet.
-----------------------------------------------------------------------------------
--
TestNG
TestNG is a java unit framework use for writting/designing of Test classes.
->Example of normal Test Class
->Example of TestNG Test class
click on add TestNG library
click on import Test
-----------------
1. Emailable Report
Report generation is very important when you are doing the Automation Testing
as well as for Manual Testing.
By looking at the result, you can easily identify how many test cases are
passed, failed and skipped.
By looking at the report, you will come to know what the status of the
project is.
Selenium web driver is used for automating the web-application, but it won't
generate any reports.
The TestNG will generate the default report.
---Steps to generate Emailable report----
1. Create test class
2. Execute Test class and refresh the project.
3. You will get test-output folder.
4. In That folder Right click on the "[Link]" and select the option
Open with the web browser or double click on it.
Note:
1. if we use sop() to display text as a output then result will be displayed
in console not in emailable report.
2. To display text in emailable report we need to use static method log
present in Reporter class.
eg. [Link]("String msg", true)
sop--> console
[Link]("msg", true)---> Console + Emailable Report
[Link]("msg", false)/[Link]("msg") --> Emailable report
--------------------------------------
2. TestNG Annotation
1. @Test
2. @BeforeMethod
3. @AfterMethod
4. @BeforeClass
5. @AfterClass
1. @Test:- Use for execution of test method/TC.
2. @BeforeMethod:- It is use for execution of test method before execution of
every test method with an annotation @Test.
3. @AfterMethod:- It is use for execution of test method after execution of
every test method with an annotation @Test.
4. @BeforeClass:- It is use for execution of test method before execution of
test class.
5. @AfterClass:- It is use for execution of test method after execution of
test class.
---------
3. TestNG Keyword:
1. invocationCount
2. priority
3. enabled
4. TimeOut
5. dependsOnMethods
1. invocationCount:
Sometimes same test method/TC need to be executed multiple which can be
possible by using TestNG keyword "invocationCount"
eg. invocationCount=5;
2. priority:
To change test method/TC execution order we need to use TestNG keyword
"priority".
eg. priority=1
Note: priority can be 1. bydefault=0
2. +ve integer
3. -ve integer
4. Duplicate
priority can't be 1. Decimals
2. Variables
3. enabled:
Disabling a test method/TC in TestNG can be achieved by setting the enabled
attribute of the @Test annotation to false.
eg. enabled=false
[Link]:
If test class contains multiple test methods if one of the test method is
time consuming to execute then
TestNG bydefault fail that TC & executes the other TC.
eg. @Test(timeOut=8000)
5. dependsOnMethods:
If 1 TC execution depends on multiple TC then we need to use
"dependsOnMethods" TestNG keyword.
eg. dependsOnMethods= {"TC name"}
----------------
Test-Suite:
It is xml file which contains all the test classes name which need to be
executed.
It is use to execute all/multiple Test classes.
<suite name="Suite name">
<test name="Test name">
<classes>
<class name="[Link]"/>
</classes>
</test>
</suite>
1 Suite---> multiple tests
1 test--> multiple classes
-------------------------------------------
Verification/Assertion
1. hard assert (Assert class) -->static method
2. soft assert (SoftAssert class) --> non-static method
--------------------
Disable TC Execution
1. from Test class using 'enabled=false' keyword
2. from suite using
2A. include keyword
2B. exclude keyword
----------------
[Link]
While executing the automation scripts, test cases may fail for several reasons.
To optimize our next runs,
we need to re-run only failed test cases
Reasons for fail TC
1. envirnment issue
2. script error
3. bug
Steps to execute [Link] file
1. Create [Link] file under project folder.
2. execute [Link] file
3. Refresh the project
4. In the test-output folder >> testng-failed. xml file will be created.
5. execute "testng-failed. xml"
In this way we can execute fail testcases in TestNG class.
------------------------
Grouping of Test cases
TestNG Groups allow you to perform groupings of different test methods
----------------------
Parallel testing or parallel execution
Parallel testing or parallel execution, as the name suggests,
is a process of running the test case parallelly rather than one after the other.
In parallel testing, the program’s multiple parts(or modules) execute together,
saving the testers a lot of time and effort.
1. using parallel='classes'
2. using parallel='tests'
---------------------
Multi browser Testing/CT
-----------------
Multi browser Testing/CT with parallel execution
---------------
TestNG advantages
It has different assertions that helps in checking the expected and actual
results.
It allows to assign priority to test methods
It allows to define dependency of one test method over other method
It provide Detailed (HTML) reports/ Emailable report
It allows grouping of test methods into test class
TestNG provides parallel execution of test methods
TestNG provides multibrowser/CT testing of test methods
-----------------------------------------------------------------------------
Data provider
----------------------------------
Junit TestNG
Parallel execution JUnit does not support to run parallel tests. TestNG
can run parallel tests.
Supports Annotation It does not support advanced annotation. It supports
advanced annotation.
Dependency tests The dependency tests are missing in JUnit. Dependency
tests are present in TestNG.
Grouping tests Grouping tests together is not possible in JUnit. Tests
can be grouped together and run parallel.
@beforeSuite
@AfterSuite
@beforeTest
@AfterTest
--------------------------------------------------
POM_DDF_TestNG example
-------------------------------------------
Capture Screenshot of only Failed TC
listner(interface):
ItestResult
To get test case status we need to use listener(interface) in TestNG.
-----------------------------------------------------------------------------------
----------
Propery file selenium:
To store imp login creadentials of application eg. UN, PWD, PIN, URL
Step 1) Creating a properties file in eclipse
1. Right-click on the main project folder and Select New-> Other->select
General -> File and click on 'Next' button->
Provide a valid file name with the extension '.properties' on the new
file resource window and click on 'Finish' button
Step 2) Storing data into properties file
Data is stored in properties file in the form of key-value pairs, with the
key being unique across the file.
Open file in Eclipse and store some data
eg- URL= [Link]
Step 3) Reading data from properties file
FileInputStream objfile = new FileInputStream([Link]("[Link]")
+"\\[Link]");
Properties obj = new Properties();
[Link](objfile);
String value= [Link]("URL");
--------------------------------------------------------------------
Extent Reporter
ExtentReports is an open-source reporting library used in selenium test
automation.
Extent reports become the first choice of Selenium Automation Testers, even
though Selenium comes with inbuilt reports using frameworks like JUnit and TestNG
-----------------------------------
------------------------------------
Maven project:
Step1: Create maven Project:
File-> New -> Project -> Maven ->Maven Project -> next -> Enter group id(Package
name) ->Enter Artifact id(Project name)-> Finish
group id: Package name
Artifact id: Project name
src/main/java folder
src/test/java folder
maven dependencies folder
[Link] file
Step2: Add jar files/dependencies
1 jar file-> 1 dependency -> 4 lines code--> [Link] website--> [Link]
file --> download --> maven dependencies folder
Step3: Create folders
browsers
Screenshots
TestData
PropertyFile
Step4: Create Library Files
UtilityClass
BaseClass
Note: update path -> [Link] file, excel sheet, property file, screenshot
folder
Step5: Design TestScript using already created framework
src/main/java folder--- all Pom classes/ library files
src/test/java folder--- All test classes
maven dependencies folder --> All downloaded jar files
[Link] file --> To add dependencies--> use to download jar files from
mvnrepository
src/main/java -->1 module--> 1 Package -->n no of pom classes
src/test/java -->1 module--> 1 Package -->n no of test classes
1 jar--> 1 dependency--> 4 lines of code -->[Link]
Note: Remove Error
Add TestNG Library
shortcut for imports --> control + Shift + O
make webdriver object to public
update path -> [Link] file, excel sheet, property file, screenshot folder
import maven project in workspace
file->import->maven->existing maven project->browse maven project
Modules in Project: 10-15
Profile
Fund
Orders
wishlist
Buy
sell
Position
Holding
Dashboard
Login
-------------------
OOPs concept in Selenium Framework
1. Interface: WebDriver driver = new ChromeDriver();
In this statement WebDriver is nothing but interface in selenium.
TakesScreenshot, ItestResult, Webdriver,WebElement
2. UPCASTING: WebDriver driver = new ChromeDriver();
above statement is nothing but UPCASTING in selenium.
3. INHERITANCE
We create a Base Class in the Framework to initialize WebDriver interface,
WebDriver waits, Property files etc., in the Base Class.
We extend the Base Class in Tests Class. that is nothing but Inheritance in
Selenium Framework.
POLYMORPHISM
Combination of overloading and overriding is known as Polymorphism.
3. 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.,
A class having multiple methods with same name but different parameters is
called Method Overloading.
eg. [Link]().frame(): - String name, int index, WebElement
4. METHOD OVERRIDING
Declaring a method in child class which is already present in the parent
class is called Method Overriding.
Examples are get and navigate methods of different drivers in Selenium.
5. ENCAPSULATION
All the POM classes in a framework are an example of Encapsulation. In POM
classes,
we declare the data members using @FindBy and initialization of data members
will be done using Constructor to utilize those in methods.
Encapsulation is a mechanism of binding code and data together in a single
unit.
Encapsulation is the process of wrapping up code and data together in a
single unit. It is used to hide the data of a class from another class.
Encapsulation can be achieved when you declare all variables as private and a
public method in a class to get the values of the variable.
6. 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 pom class but we can’t see these locators in the
tests. Literally we hide the locators from the tests.
Abstraction is the methodology of hiding the implementation of internal
details and showing the functionality to the users.
-----------------------------------------------------
[Link]
UN: SanjayChetlure
pWD:SanjayC@1992
new repo:
url: [Link]
-----------------------------------------------------------------------
GitHub Repository
UN: Vaishnavikeshaowar
pwd: Vaishnavikeshaowar@12345
url: [Link]
1 github acc--> multiple repository
1 repository--> multiple branches (Master)
1 project =1 repository
steps to create repository in github server
1. create a project in eclipse
2. create acc in github
3. create repository in github
Create local Repository(git)
right click on project-->Team-->Share project--select checkbox
-->select checkbox-->Create repository-->Finish
open local repository(git) window
click on quick search-->search "git repositories" --> git repositories(git)
commit source code from local machine to local repository
right click on project-->Team-->Add to index-->
right click on project-->Team-->Commit--->add commit message-->commit
push source code from local repository(git) to remote repository(bitbucket/github)
right click on project-->Team-->remote-->push-->Enter URL--> Enter UN & PWD
-->next-->source ref-->master-->add Specification-->finish
Clone repository
open git repository window--> clone a git repository-->
Enter repository URL,UN & Pwd--> Next-->select branch & Next--> Finish
Move Project from local repo to local machin(project explorer/working directory)
(import project)
File-->import-->Git-->Project from git-->Existing local repo-->select project--
>Finish
https:[Link]
UN: SanjayChetlure
pWD:SanjayC@1992
UN: ShashankWanzal
pwd: Shashank@5238
URL: [Link]
THM944
Bisen@7566
812073
UN: IM5834
PWD: 00000000
Pin: 997158
-------------------------------------------------------
Investment Banking(Kite Zeroda) Project Scenarios
1. Quantity field should be by default 1
2. when we click on stock it should show buy ,sell,view chart and other details
26. Wishlist-->add/remove
3. while selecting order if we select CNC (cash and carry ) order ,we can hold the
stock for long term -->manual
4. While Selecting order,if we select MIS(margine intraday sqare) it should
automatically exit at 3-20 pm.-->manual
5. if you try to place order ,but you don't have fund in your account then it
should display insufficient fund msg
6. if you forget to logout account,at end of every day it should automatically
logged out --manual/automation
7. when we placed the order by selecting market price ,price field should be
disabled
8. when we placed limit order price field should be editable
11. price field should accept value in multiple of 0.05 (eg 55.05,55,56.15 etc
accepted) (55.06,55.07 not accepted)
12. after placing order ,in orders tab it will show Executed/pending/rejected
orders
1. valid 2. invalid
14. after clicking on user id tab it should show customer details.
15. in options quantity field should accept in Lott eg ( eg. 25 for banknifty,75
for nifty, depends on stock)
16. while adding fund in your demat account ,after clicking on add fund button ,
different payment options should enabled
17. when we click on withdraw button , withdrawal amount field should be enabled
and proceed button should be disabled.
18. when we click on recent withdrawal option,it should show our withdrawal
activities
19. when we click on AMO (after market order) option, we should able to placed
order after market timing-->manual
21. when we click on chart it should show different formats of chart (eg 1d,5d,1M
etc ) d- day,M- month
22. application should show same price of stock as per NSE or bse ,if we open an
application in different platforms or machines, mobile etc --->CT
24. if we placed withdrawal request, ammount should be credit next day before 1 pm
(if no hollyday) otherwise it should credit next of hollyday-->manual
25. while withdrawing funds ,it should show withdrawable ammount.
13. in portfolio tab , should show holdings and position of stock. --> mobile
20. at time of order placing, BSE Or NSE only one should enabled
BY4454
India@11
727252
Modules in Project: 10-15
Profile
Fund
Orders
wishlist
Buy
sell
Position
Holding
Dashboard
Login
-----------------------------------------------
Total modules in a project: -- 10--------->10 to 15
Total Webpage/pom classes in project: 200 -->150 to 250
Test classes in project : 300 : 150 to 300
Test cases in each Test class: 5 2 to 10
Total no of test script in project: 1500 800 to 2500 test scripts in project
1 features= 1 module = TC in each module 130 --> 50 to 200
Test script per day: depends on complexity of Test script (1 to 4) (avg 2)
test script per month (20 working days--> 10 days devp): avg (20 ) 15 to 25
9. when we placed bracket order(BO) then stoploss, target, trailing Stop loss
should enable
10. when we placed cover order (co) only Stop loss field enabled
Total modules in a project: -- 10--------->10 to 15
webpages in each module:---> 20 ---> 10-30
Pom class in each module:---> 20 ---> 10-30
Total pom classes in project:10*20: 200 -->150 to 300
1 features= 1 module = TC in each module 100 --> 50 to 200
Test cases in each module: 100 -- 50--200
Test cases in each Test class: 4 3 to 10
Test classes in each module: 100/4= 25 -- 10 to 40
Test classes in project : 25 * 10: 250 : 150 to 300
Total no of test script in project: 250*4: 1000: 800 to 2000 test scripts in
project
Test script per day: depends on complexity of Test script (1 to 4) (avg 2)
test script per month (20 working days--> 10 days devp): avg (20 )
src/main/java- All pom classes
src/test/java- All test classes
src/main/java- library files/config files
---------------------------------------
What are Broken Links?
Broken links are links or URLs that are not reachable. They may be down or not
functioning due to some server error.
Why should you check Broken links?
You should always make sure that there are no broken links on the site because the
user should not land into an error page.
How to check the Broken Links and images
For checking the broken links, you will need to do the following steps.
1. Collect all the links in the web page based on <a> tag.
2. Send HTTP request for the link and read HTTP response code.
3. Find out whether the link is valid or broken based on HTTP response code.
4. Repeat this for all the links captured.
----------------------------------------------------
1. diffrence between String & Stringbuffer
String
StringBuffer/Stringbuilder
1. String class is immutable. StringBuffer/Stringbuilder
class is mutable.
2. String is slow and consumes more memory when StringBuffer is fast and
consumes less memory when you cancat strings.
you concat too many strings because every time
it creates new instance.
-----------------------
2. diffrence between Stringbuffer & Stringbuilder
Stringbuffer Stringbuilder
StringBuffer was introduced in Java 1.0(Legacy) StringBuilder was
introduced in Java 1.5 (not Legacy)
performance: low performance: Hight
synchronized & Thread safe not synchronized & not Thread
safe
-------------------------------
3. diffrence between Hashmap & HashTable
HashMap Hashtable
1. not legacy class legacy class
2. performance: high performance: low
3. HashMap is non synchronized HashTable is synchronized.
It is not-thread safe It is thread safe
--------------------------------------
4. Diff between final, finally & finalize
Final: is a keyword
Finally: finally is the block in Java Exception Handling to execute the important
code whether the exception occurs or not
Finalize: finalize is the method in Java which is used to perform clean up
processing just before object is garbage collected.
4. Diff between Throw & Throws
Throw: use to handle user defined exception
Throws: use to handle pre-defined exception
-----------------------------------------------------------------------------------
---
Synchronization: matching selenium test script speed with browser speed
selenium wait:
1. Implicit wait:
Applicable: Complete webpage
1 parameter: Time value (seconds)
2. Explicit wait:
Applicable: Single element in a webpage
1 parameter: Time value(seconds)
2 parameter: Condition (isselected, isdisplayed, isenabled)
3. Fluent wait:
Applicable: single element
1 parameter: Time value(seconds) --10
2 parameter: Condition (isselected, isdisplayed, isenabled)
3 frequency: time(time in sec)- 5 sec
--Automation Life Cycle/Steps involed in automation--
1. Define scope of automation
2. Selecting correct automation tool/Framework
3. Script Development
4. Execution
5. Maintanace
------------------------------------------------------------
1 gitHub acc --> multiple repository
1 repository---> multiple branches (master)
how to solve conflict issue-->
Teal lead create 2 more branches
master--> pre-defined branches
vishal,pratik--> user defined branches
multiple branches__>
1. master
2. Vishal
3. pratik
--> pull request(pr) to TL from vishal & pratik
TL --> code review of vishal & pratik
seperate files ->ok-->move vishal & pratik code to master branch
code correction--> rpl code change to pratik/vishal--->code pull--> code modify-->
code push--> TL pull request-->master branach
next day--> pull latest code from master branch
-------------------------------------------
containsKey(key)
put(key,value)
get(key)
keySet()