PracticeNotes
PracticeNotes
CoreJava:
OOPS Concepts
- Inheritance - Reusability, Extends keyword
- If we inherited no issue
// not finalized
- we can use static? - The best usage is create object,
parallel executions, mult threading concepts we will get issue when we static
variables/functions
//why to create
// need to check
-Interface can have only abstract methods. Since Java 8, it can have default and
static methods also.
- Abstract class can have final, non-final, static and non-static variables.
- abstract class can have class members like private, protected, etc.
Strings
Exceptions
Collections
Programs
upcasting & downcasting
TestNG:
Selenium:
Locators:
id
name
className
tag
linkText
partialLinkText
xpath = //tagName[@attribute='value']
conditions:
and, or
axis:
- preceding-sibling -> backward traverse
- following-sibling -> forward traverse
cssSelector= tagName[attribute='value']
axis:
following-sibling similar:
tag + tag
Exceptions:
UnsupportedOperationException
InvalidSelectorException
ElementClickInterceptedException
ElementNotInteractableException
NoSuchElementException
TimeoutException
Waits:
WebDriverWait:
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for
element to be clickable: By.name: start my free tria (tried for 20 second(s) with
500 milliseconds interval)
FluentWait:
org.openqa.selenium.TimeoutException: Expected condition failed: Failed due to
element not found (tried for 15 second(s) with 8000 milliseconds interval)
Verification Methods:
- isDisplayed()
- isSelected()
- isEnabled()
Git Commands:
STep1: git clone url
Step2: git status
STep3: git add test.java
Step4: git commit -m "java file"
Step5: git push