├── .gitignore
├── test-output
├── old
│ ├── Default suite
│ │ ├── groups.html
│ │ ├── Default test.properties
│ │ ├── reporter-output.html
│ │ ├── main.html
│ │ ├── methods-not-run.html
│ │ ├── index.html
│ │ ├── methods.html
│ │ ├── methods-alphabetical.html
│ │ ├── classes.html
│ │ ├── testng.xml.html
│ │ └── toc.html
│ └── index.html
├── failed.png
├── passed.png
├── skipped.png
├── collapseall.gif
├── bullet_point.png
├── navigator-bullet.png
├── testng.css
├── junitreports
│ ├── TEST-Selenium.Calender.xml
│ ├── TEST-Selenium.BasicAuth.xml
│ └── TEST-Selenium.ActionsPractice.xml
├── testng-failed.xml
├── Default suite
│ ├── testng-failed.xml
│ ├── Default test.xml
│ └── Default test.html
├── testng-results.xml
├── emailable-report.html
├── testng-reports2.js
├── testng-reports.js
├── testng-reports.css
├── testng-reports1.css
├── index.html
└── jquery-3.4.1.min.js
├── practice.png
├── target
└── classes
│ ├── Java
│ ├── G.class
│ ├── ClassOne.class
│ ├── Student.class
│ ├── LoopConcept.class
│ ├── ArrayConcept.class
│ └── StringConcept.class
│ ├── HomeWork
│ └── Task.class
│ ├── Modifier01
│ ├── Test.class
│ ├── dafsd.class
│ ├── ClassOne.class
│ └── ClassTwo.class
│ └── Modifier02
│ └── Test02.class
├── .settings
├── org.eclipse.m2e.core.prefs
├── org.eclipse.core.resources.prefs
└── org.eclipse.jdt.core.prefs
├── src
└── main
│ └── java
│ ├── Modifier01
│ ├── dafsd.java
│ ├── ClassTwo.java
│ ├── ClassOne.java
│ └── Test.java
│ ├── OOP1
│ ├── FDR.java
│ ├── BB.java
│ ├── DBBL.java
│ └── Test.java
│ ├── Modifier02
│ └── Test02.java
│ ├── Java
│ ├── ImmutableString.java
│ ├── Student.java
│ ├── ClassOne.java
│ ├── LoopConcept.java
│ ├── G.java
│ ├── ArrayConcept.java
│ ├── StringConcept.java
│ └── Date.java
│ ├── OOP2
│ ├── Qatar.java
│ ├── Test.java
│ └── Plane.java
│ ├── Selenium
│ ├── Env.properties
│ ├── WDManager.java
│ ├── BadSSL.java
│ ├── LocatorsStrategy.java
│ ├── ClassTwo.java
│ ├── Hban.java
│ ├── AutoSuggestiveDropDown.java
│ ├── BootStrapDropDown.java
│ ├── Frame.java
│ ├── WebTable.java
│ ├── TestNG.java
│ ├── Calender.java
│ ├── BasicAuth.java
│ ├── TrickyDom.java
│ ├── ActionsPractice.java
│ └── ClassOne.java
│ └── HomeWork
│ └── Task.java
├── .project
├── .classpath
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/groups.html:
--------------------------------------------------------------------------------
1 |
Groups used for this test run
--------------------------------------------------------------------------------
/test-output/old/Default suite/Default test.properties:
--------------------------------------------------------------------------------
1 | [SuiteResult context=Default test]
--------------------------------------------------------------------------------
/practice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/practice.png
--------------------------------------------------------------------------------
/test-output/old/Default suite/reporter-output.html:
--------------------------------------------------------------------------------
1 | Reporter output
--------------------------------------------------------------------------------
/test-output/failed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/failed.png
--------------------------------------------------------------------------------
/test-output/passed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/passed.png
--------------------------------------------------------------------------------
/test-output/skipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/skipped.png
--------------------------------------------------------------------------------
/target/classes/Java/G.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/G.class
--------------------------------------------------------------------------------
/test-output/collapseall.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/collapseall.gif
--------------------------------------------------------------------------------
/test-output/bullet_point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/bullet_point.png
--------------------------------------------------------------------------------
/test-output/navigator-bullet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/test-output/navigator-bullet.png
--------------------------------------------------------------------------------
/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/target/classes/HomeWork/Task.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/HomeWork/Task.class
--------------------------------------------------------------------------------
/target/classes/Java/ClassOne.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/ClassOne.class
--------------------------------------------------------------------------------
/target/classes/Java/Student.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/Student.class
--------------------------------------------------------------------------------
/target/classes/Java/LoopConcept.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/LoopConcept.class
--------------------------------------------------------------------------------
/target/classes/Modifier01/Test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Modifier01/Test.class
--------------------------------------------------------------------------------
/target/classes/Modifier01/dafsd.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Modifier01/dafsd.class
--------------------------------------------------------------------------------
/target/classes/Java/ArrayConcept.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/ArrayConcept.class
--------------------------------------------------------------------------------
/target/classes/Java/StringConcept.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Java/StringConcept.class
--------------------------------------------------------------------------------
/target/classes/Modifier01/ClassOne.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Modifier01/ClassOne.class
--------------------------------------------------------------------------------
/target/classes/Modifier01/ClassTwo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Modifier01/ClassTwo.class
--------------------------------------------------------------------------------
/target/classes/Modifier02/Test02.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sourovbm21/TestingBEEJulySession/HEAD/target/classes/Modifier02/Test02.class
--------------------------------------------------------------------------------
/src/main/java/Modifier01/dafsd.java:
--------------------------------------------------------------------------------
1 | package Modifier01;
2 |
3 | public class dafsd {
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/main.html:
--------------------------------------------------------------------------------
1 | Results for Default suite
2 | Select a result on the left-hand pane.
3 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/main/java=UTF-8
3 | encoding//src/test/java=UTF-8
4 | encoding/=UTF-8
5 |
--------------------------------------------------------------------------------
/src/main/java/OOP1/FDR.java:
--------------------------------------------------------------------------------
1 | package OOP1;
2 |
3 | public interface FDR {
4 |
5 |
6 |
7 |
8 | public void carloan();
9 | public void healthLoan();
10 |
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/methods-not-run.html:
--------------------------------------------------------------------------------
1 | Methods that were not run
2 | | Selenium.BasicAuth.basicAuthNotByPass |
3 | | Selenium.BasicAuth.basicAuth |
4 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/index.html:
--------------------------------------------------------------------------------
1 | Results for Default suite
2 |
6 |
7 |
--------------------------------------------------------------------------------
/src/main/java/Modifier02/Test02.java:
--------------------------------------------------------------------------------
1 | package Modifier02;
2 |
3 | public class Test02 {
4 |
5 |
6 |
7 | public static void Hi(){
8 |
9 | System.out.println("i am from different pakage ");
10 |
11 | }
12 |
13 |
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/Modifier01/ClassTwo.java:
--------------------------------------------------------------------------------
1 | package Modifier01;
2 |
3 | public class ClassTwo {
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | void CTwo(){
13 |
14 | System.out.println("i am from Class two ");
15 |
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/Java/ImmutableString.java:
--------------------------------------------------------------------------------
1 | package Java;
2 |
3 | public class ImmutableString {
4 |
5 | public static void main(String[] args) {
6 |
7 |
8 | String s ="abc";
9 | String y ="abc";
10 | System.out.println(s.concat(y));
11 | s = s.concat(y);
12 | System.out.println(s);
13 |
14 |
15 |
16 |
17 |
18 |
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/test-output/testng.css:
--------------------------------------------------------------------------------
1 | .invocation-failed, .test-failed { background-color: #DD0000; }
2 | .invocation-percent, .test-percent { background-color: #006600; }
3 | .invocation-passed, .test-passed { background-color: #00AA00; }
4 | .invocation-skipped, .test-skipped { background-color: #CCCC00; }
5 |
6 | .main-page {
7 | font-size: x-large;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/src/main/java/Java/Student.java:
--------------------------------------------------------------------------------
1 | package Java;
2 |
3 | public class Student {
4 |
5 | String name ;
6 | int age ;
7 | String dept;
8 |
9 |
10 |
11 | //sourov //27 //science
12 | Student(String name, int age,String dept){
13 |
14 | this.name = name;
15 | this.age = age;
16 | this.dept =dept;
17 |
18 | }
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/test-output/junitreports/TEST-Selenium.Calender.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test-output/junitreports/TEST-Selenium.BasicAuth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/main/java/Modifier01/ClassOne.java:
--------------------------------------------------------------------------------
1 | package Modifier01;
2 |
3 | public class ClassOne {
4 |
5 |
6 |
7 |
8 | private int x=100;
9 | public int y=200;
10 |
11 | String s="sourov";
12 |
13 | public static void Cone(){
14 |
15 | System.out.println("i am from Class one ");
16 |
17 | }
18 |
19 | protected void prot(){
20 |
21 | System.out.println("i am from Class one ");
22 |
23 | }
24 |
25 |
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/OOP2/Qatar.java:
--------------------------------------------------------------------------------
1 | package OOP2;
2 |
3 | public class Qatar extends Plane{
4 |
5 | //Has-A relation
6 |
7 |
8 |
9 | Qatar (){
10 | System.out.println("inside child class ");
11 | }
12 |
13 |
14 |
15 | public void enginge() {
16 |
17 | }
18 |
19 | @Override
20 | public void start() {
21 |
22 |
23 | }
24 |
25 | public void refuel() {
26 | System.out.println("@@@@@i am inside child refuel");
27 | }
28 |
29 |
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/OOP2/Test.java:
--------------------------------------------------------------------------------
1 | package OOP2;
2 |
3 | public class Test {
4 |
5 |
6 |
7 |
8 | public static void main(String[] args) {
9 |
10 |
11 | Qatar qa = new Qatar();
12 |
13 | qa.enginge();
14 | qa.start();
15 | qa.fuel();
16 | qa.stop();
17 | qa.fuel();
18 | //qa.refuel();
19 |
20 | Plane pa = new Qatar();
21 | pa.fuel();
22 | pa.start();
23 | pa.stop();
24 | pa.refuel();
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/Env.properties:
--------------------------------------------------------------------------------
1 | urlOne =https://rahulshettyacademy.com/AutomationPractice/
2 | bad_SSL =https://expire.badssl.com/
3 | aut_concept = http://the-internet.herokuapp.com/basic_auth
4 | j_Query =https://jqueryui.com/draggable/
5 | s_hub = https://selectorshub.com/xpath-practice-page/
6 | boot_Strap_Dropdown = https://www.jquery-az.com/boots/demo.php?ex=63.0_2
7 | Auto_S_D_D = https://www.amazon.co.uk/
8 | E_List = https://www.flipkart.com/
9 | browser=chrome
10 | url_php=https://www.phptravels.net/login
11 | username=user@phptravels.com
12 | password=demouser
--------------------------------------------------------------------------------
/test-output/junitreports/TEST-Selenium.ActionsPractice.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-output/testng-failed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | JulySession
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.m2e.core.maven2Builder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.m2e.core.maven2Nature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/test-output/Default suite/testng-failed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main/java/OOP1/BB.java:
--------------------------------------------------------------------------------
1 | package OOP1;
2 |
3 | public interface BB {
4 |
5 |
6 |
7 |
8 | /*
9 | * no method body only method declaration.
10 | * not static method;
11 | * variable by default static.
12 | * can not create and object of an interface.
13 | * No costrutor;
14 | * 100% abstraction can be achieve.
15 | *
16 | */
17 |
18 | int branch = 5;
19 | public void credit();
20 | public void loan();
21 | public void mortgage();
22 | public void can_not_cell_doller();
23 | public void can_accept_russian_rubel();
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.compliance=1.8
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
9 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
10 | org.eclipse.jdt.core.compiler.release=disabled
11 | org.eclipse.jdt.core.compiler.source=1.8
12 |
--------------------------------------------------------------------------------
/test-output/Default suite/Default test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/main/java/Java/ClassOne.java:
--------------------------------------------------------------------------------
1 | package Java;
2 |
3 | import java.time.LocalDateTime;
4 | import java.time.format.DateTimeFormatter;
5 |
6 | public class ClassOne {
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | public static void main(String[] args) {
19 | // TODO Auto-generated method stub
20 |
21 | int y=300000000;
22 | long ph=0000000000000000000000000000000000000000000000000l;
23 | String yy="Sourov";
24 |
25 |
26 | LocalDateTime now = LocalDateTime.now();
27 | DateTimeFormatter fm = DateTimeFormatter.ofPattern("dd/MM/yyyy");
28 | System.out.println(fm.format(now));
29 |
30 |
31 |
32 | }
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/OOP2/Plane.java:
--------------------------------------------------------------------------------
1 | package OOP2;
2 |
3 | public abstract class Plane {
4 |
5 |
6 | /*
7 | * Can have abstruct and no abastract method both.
8 | * Can't create an object
9 | * Can create constructor
10 | *
11 | */
12 |
13 |
14 | Plane(){
15 | System.out.println("inside parent class ");
16 | }
17 |
18 |
19 | public abstract void start ();
20 |
21 | public void stop() {
22 | System.out.println("i am inside Plane stop ");
23 | }
24 |
25 |
26 | public void fuel() {
27 | System.out.println("i am inside Plane fuel");
28 | }
29 |
30 | public void refuel() {
31 | System.out.println("@@@@@@i am inside Plane refuel");
32 | }
33 |
34 |
35 |
36 |
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/test-output/old/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Test results
6 | | Suite | Passed | Failed | Skipped | testng.xml |
7 | | Total | 1 | 0 | 0 | |
8 | | Default suite |
9 | 1 | 0 | 0 | Link |
10 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/methods.html:
--------------------------------------------------------------------------------
1 | Methods run, sorted chronologically
>> means before, << means after
Default suite(Hover the method name to see the test class name)
2 |
3 | | Time | Delta (ms) | Suite configuration | Test configuration | Class configuration | Groups configuration | Method configuration | Test method | Thread | Instances |
4 | | 22/10/22 12:56:25 | 0 | | | | | | basicAuthUsingUri |
5 | main@785570251 | |
6 |
7 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/methods-alphabetical.html:
--------------------------------------------------------------------------------
1 | Methods run, sorted chronologically
>> means before, << means after
Default suite(Hover the method name to see the test class name)
2 |
3 | | Time | Delta (ms) | Suite configuration | Test configuration | Class configuration | Groups configuration | Method configuration | Test method | Thread | Instances |
4 | | 22/10/22 12:56:25 | 0 | | | | | | basicAuthUsingUri |
5 | main@785570251 | |
6 |
7 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | | Class name |
4 | Method name |
5 | Groups |
6 |
7 | | Selenium.BasicAuth |
8 | | |
9 |
10 | | @Test |
11 |
12 |
13 | | |
14 | basicAuth |
15 | |
16 |
17 | | |
18 | basicAuthUsingUri |
19 | |
20 |
21 | | |
22 | basicAuthNotByPass |
23 | |
24 |
25 | | @BeforeClass |
26 |
27 |
28 | | @BeforeMethod |
29 |
30 |
31 | | @AfterMethod |
32 |
33 |
34 | | @AfterClass |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/main/java/OOP1/DBBL.java:
--------------------------------------------------------------------------------
1 | package OOP1;
2 |
3 | public class DBBL implements BB,FDR{
4 |
5 |
6 |
7 |
8 | //if a class is implementing any interface then it is mandatory to define or override all methods of that interface.
9 | public void credit() {
10 |
11 | System.out.println("i am in credit method ");
12 | }
13 |
14 | public void loan() {
15 | System.out.println("i am in loan method ");
16 |
17 | }
18 |
19 | public void mortgage() {
20 |
21 | }
22 |
23 | public void homeloan() {
24 |
25 | }
26 |
27 | public void studentloan() {
28 |
29 | }
30 |
31 | public void can_not_cell_doller() {
32 |
33 |
34 | }
35 |
36 | public void can_accept_russian_rubel() {
37 |
38 | }
39 |
40 | public void carloan() {
41 | System.out.println("FROM fdr ");
42 |
43 |
44 | }
45 |
46 | public void healthLoan() {
47 |
48 |
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/test-output/testng-results.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/WDManager.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import org.openqa.selenium.WebDriver;
4 | import org.openqa.selenium.chrome.ChromeDriver;
5 |
6 | import io.github.bonigarcia.wdm.WebDriverManager;
7 |
8 | public class WDManager {
9 |
10 | public static void main(String[] args) {
11 |
12 |
13 |
14 |
15 |
16 | WebDriverManager.chromedriver().cachePath("/Users/tohidur/Desktop/MyChromeDriver").avoidOutputTree().setup();
17 | //System.setProperty("webdriver.chrome.driver","/Users/tohidur/Desktop/MyChromeDriver/chromedriver");
18 | //WebDriverManager.chromedriver().cachePath("/Users/tohidur/Desktop/MyChromeDriver").avoidBrowserDetection().setup();
19 | //System.setProperty("webdriver.chrome.driver","/Users/tohidur/Desktop/MyChromeDriver/chromedriver/mac64/107.0.5304.62/chromedriver");
20 |
21 |
22 | WebDriver driver = new ChromeDriver();
23 | driver.get("https://www.google.co.uk/");
24 | String title = driver.getTitle();
25 | System.out.println(title);
26 |
27 |
28 |
29 |
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/testng.xml.html:
--------------------------------------------------------------------------------
1 | testng.xml for Default suite<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Default suite" guice-stage="DEVELOPMENT">
<test thread-count="5" name="Default test" verbose="2">
<classes>
<class name="Selenium.BasicAuth">
<methods>
<include name="basicAuthUsingUri"/>
</methods>
</class> <!-- Selenium.BasicAuth -->
</classes>
</test> <!-- Default test -->
</suite> <!-- Default suite -->
--------------------------------------------------------------------------------
/src/main/java/Modifier01/Test.java:
--------------------------------------------------------------------------------
1 | package Modifier01;
2 |
3 | import java.util.Date;
4 | import java.util.Random;
5 |
6 | public class Test extends ClassOne{
7 |
8 |
9 |
10 | public static void main(String[] args) {
11 |
12 |
13 | //ClassOne classone = new ClassOne();
14 |
15 | ClassOne.Cone();
16 | System.out.print(":-> ");
17 | Modifier02.Test02.Hi();
18 |
19 |
20 | Test test = new Test();
21 |
22 | test.prot();
23 |
24 |
25 |
26 |
27 | System.out.println("i am sourov");
28 |
29 |
30 | for ( int i= 1; i <=100;i++ ) {
31 |
32 | System.out.println("i am sourov :--> "+i);
33 |
34 | if (i % 2 ==0 ) {
35 | System.out.println("i am a even number:--> "+i);
36 | }
37 | }
38 |
39 |
40 | int s=5;
41 | while (s <= 5) {
42 | System.out.println("i am less then 5 ");
43 | break;
44 | }
45 |
46 |
47 |
48 | //
49 | //
50 | // ClassTwo classtwo =new ClassTwo();
51 | //
52 | // classtwo.CTwo();
53 |
54 | Date D = new Date();
55 | D.getDate();
56 | System.out.println(D.getDate());
57 | System.out.println(D);
58 |
59 | Random r = new Random();
60 |
61 |
62 |
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/main/java/OOP1/Test.java:
--------------------------------------------------------------------------------
1 | package OOP1;
2 |
3 | public class Test {
4 |
5 |
6 |
7 |
8 |
9 | public static void main(String[] args) {
10 |
11 |
12 | // WebDriver driver = new ChromeDriver();
13 |
14 | //ChromeDriver driver = new ChromeDriver();
15 |
16 | DBBL dbbL = new DBBL();//Static polymorphism
17 |
18 | //all the object of dbbL class will be accessible
19 | dbbL.credit();
20 | dbbL.credit();
21 | dbbL.carloan();
22 | dbbL.can_accept_russian_rubel();
23 | dbbL.can_not_cell_doller();
24 | dbbL.healthLoan();
25 | dbbL.homeloan();
26 | dbbL.loan();
27 | dbbL.mortgage();
28 | dbbL.studentloan();
29 |
30 | //
31 | //child class object can be referred by parent interface/class referred variable.
32 | //Only overridden method will be accessible
33 |
34 | BB bb = new DBBL();//Dynamic polymorphism//Runtime // Top casting
35 |
36 |
37 |
38 | //
39 | FDR fdr = new DBBL();
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | //Abstraction
49 | /*
50 | * inter
51 | * abs class
52 | */
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/BadSSL.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import java.util.concurrent.TimeUnit;
4 |
5 | import org.openqa.selenium.WebDriver;
6 | import org.openqa.selenium.chrome.ChromeDriver;
7 | import org.openqa.selenium.chrome.ChromeOptions;
8 | import org.openqa.selenium.firefox.FirefoxDriver;
9 |
10 | import io.github.bonigarcia.wdm.WebDriverManager;
11 |
12 | public class BadSSL {
13 |
14 | public static void main(String[] args) {
15 |
16 |
17 |
18 | ChromeOptions cop = new ChromeOptions();
19 | //cop.setAcceptInsecureCerts(true);
20 | WebDriverManager.chromedriver().setup();
21 | WebDriver driver = new ChromeDriver(cop);
22 |
23 | // WebDriverManager.firefoxdriver().setup();
24 | // WebDriver driver = new FirefoxDriver();
25 |
26 | // WebDriverManager.edgedriver().setup();
27 | // WebDriver driver = new EdgeDriver();
28 |
29 | driver.manage().window().maximize();
30 | driver.manage().deleteAllCookies();
31 | driver.manage().timeouts().pageLoadTimeout(6000l, TimeUnit.SECONDS);
32 | driver.manage().timeouts().implicitlyWait(3000l, TimeUnit.SECONDS);
33 | driver.get("https://expire.badssl.com/");
34 |
35 | ///
36 |
37 |
38 |
39 |
40 |
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/Java/LoopConcept.java:
--------------------------------------------------------------------------------
1 | package Java;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Collections;
5 | import java.util.List;
6 |
7 | public class LoopConcept {
8 |
9 | public static void main(String[] args) {
10 |
11 |
12 | //For loop
13 |
14 |
15 |
16 | //While Loop
17 | //While loop condition has to be true and only accept only one arguments.
18 |
19 | int i=1; int n=5;
20 |
21 | while (i<=n) {
22 | System.out.println(i);
23 |
24 | i++; //i=i+1;
25 |
26 |
27 | }
28 |
29 |
30 |
31 | //Do while Loop
32 | System.out.println("inside the do while loop ");
33 |
34 | int x=1; int y=5;
35 |
36 |
37 | do {
38 |
39 | System.out.println(x);
40 | x++;//x = x+1;
41 |
42 | }while (x<=y);
43 |
44 |
45 | List al = new ArrayList();
46 | al.add("january");
47 | al.add("February");
48 | al.add("March");
49 | al.add("December");
50 | System.out.println(al);
51 | Collections.sort(al);
52 | System.out.println(al);
53 | List a = new ArrayList();
54 | a.add(1);
55 | a.add(7);
56 | a.add(3);
57 | a.add(8);
58 |
59 | System.out.println(a);
60 | Collections.sort(a);
61 | System.out.println(a);
62 |
63 |
64 |
65 |
66 |
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/LocatorsStrategy.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | public class LocatorsStrategy {
4 |
5 | // tag[attr='value']
6 | // input[name='email'] -- css
7 | // input[@name='email'] -- xpath
8 |
9 | // xpath vs css:
10 | // 1. syntax: css is btr than xpath
11 | // 2. backward: xpath
12 | // 3. siblings: xpath
13 | // 4. webtable: xpath
14 | // 5. comma: css
15 | // 6. text: xpath
16 | // 7. dynamic: both
17 | // 8. SVG Elements: xpath
18 | // 9. shadow dom : css selector
19 | // 10. index: both
20 | // 11. Relative Locators
21 |
22 | //CSS child to parent: NA
23 | // backward traversing in CSS: NA
24 |
25 | // xpath axes:
26 | // input[@name='email'] -- xpath
27 |
28 | // parent to child:
29 | // form[@id='hs-login']//input[@id='username']
30 | // div[@class='private-form__input-wrapper']/input[@id='username']
31 | // div[@class='private-form__input-wrapper']/child::input[@id='username']
32 | // select[@id='Form_submitForm_Country']/option
33 | // select[@id='Form_submitForm_Country']/child::option
34 |
35 | // child to parent:
36 | // backward traversing in xpath:
37 | // input[@id='username']/../../../../../../../../../..
38 | // input[@id='username']/parent::div
39 |
40 | // child to ancestor:
41 | // input[@id='username']/ancestor::form
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/test-output/old/Default suite/toc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Results for Default suite
4 |
5 |
6 |
7 |
8 | Results for
Default suite
9 |
23 |
24 |
25 | | Default test (1/0/0) |
26 | Results
27 | |
28 | |
29 |
30 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/ClassTwo.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import java.util.concurrent.TimeUnit;
4 |
5 | import org.openqa.selenium.WebDriver;
6 | import org.openqa.selenium.chrome.ChromeDriver;
7 |
8 | import io.github.bonigarcia.wdm.WebDriverManager;
9 |
10 | public class ClassTwo {
11 |
12 | public static void main(String[] args) throws InterruptedException {
13 |
14 |
15 | WebDriverManager.chromedriver().setup();
16 | WebDriver driver = new ChromeDriver();
17 |
18 | // WebDriverManager.firefoxdriver().setup();
19 | // WebDriver driver = new FirefoxDriver();
20 | // WebDriverManager.edgedriver().setup();
21 | // WebDriver driver = new EdgeDriver();
22 |
23 | driver.manage().window().maximize();
24 | driver.manage().deleteAllCookies();
25 | driver.manage().timeouts().pageLoadTimeout(6000l, TimeUnit.SECONDS);
26 | driver.manage().timeouts().implicitlyWait(3000l, TimeUnit.SECONDS);
27 | driver.get("https://www.google.co.uk/");
28 | Thread.sleep(3000);
29 | driver.navigate().to("https://en-gb.facebook.com/");
30 | Thread.sleep(3000);
31 | driver.navigate().back();
32 | Thread.sleep(3000);
33 | driver.navigate().forward();
34 | Thread.sleep(3000);
35 | driver.navigate().refresh();
36 | Thread.sleep(3000);
37 | driver.quit();
38 |
39 |
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/Hban.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import org.openqa.selenium.By;
4 | import org.openqa.selenium.WebDriver;
5 | import org.openqa.selenium.chrome.ChromeDriver;
6 | import org.testng.annotations.Test;
7 |
8 | import io.github.bonigarcia.wdm.WebDriverManager;
9 |
10 | public class Hban {
11 |
12 | @Test
13 |
14 | public void hban() {
15 | //
16 | WebDriverManager.chromedriver().setup();
17 | WebDriver driver = new ChromeDriver();
18 | driver.get("https://smsreceivefree.com/info/19175903978/");
19 | String s = driver.findElement(By.xpath("(//*[contains(text(),'Valley Bank Access Code')])[1]")).getText();
20 | // Valley Bank Access Code. Your access code is 241455. Reply HELP for help
21 | System.out.println("Just Printing AfterGetText Method : "+ s);
22 | System.out.println("i am from method : "+givenCode(s));
23 | //driver.findElement(By.xpath("")).sendKeys(givenCode(s));
24 | driver.quit();
25 |
26 | }
27 |
28 |
29 | public String givenCode (String str ) {
30 | //str.trim();
31 | String S[] = str.trim().split("is");
32 | //String first = S[0];
33 | String second = S[1];
34 | //second.trim();
35 | String secondTrim[] = second.trim().split(" ");
36 | String sSecond = secondTrim[0];
37 | String actual = sSecond.trim().substring(0, sSecond.length() - 1);
38 | return actual ;
39 |
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 |
6 | July
7 | Session
8 | 0.0.1-SNAPSHOT
9 | jar
10 |
11 | Session
12 | http://maven.apache.org
13 |
14 |
15 | UTF-8
16 | 1.8
17 | 1.8
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | org.seleniumhq.selenium
28 | selenium-java
29 | 4.5.2
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | org.testng
38 | testng
39 | 7.6.1
40 | test
41 |
42 |
43 |
44 |
45 |
46 | io.github.bonigarcia
47 | webdrivermanager
48 | 5.2.3
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/AutoSuggestiveDropDown.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import java.util.List;
4 | import java.util.concurrent.TimeUnit;
5 |
6 | import org.openqa.selenium.By;
7 | import org.openqa.selenium.WebDriver;
8 | import org.openqa.selenium.WebElement;
9 | import org.openqa.selenium.chrome.ChromeDriver;
10 |
11 | import io.github.bonigarcia.wdm.WebDriverManager;
12 |
13 | public class AutoSuggestiveDropDown {
14 |
15 | public static void main(String[] args) throws InterruptedException {
16 |
17 | WebDriverManager.chromedriver().setup();
18 | WebDriver driver = new ChromeDriver();
19 | driver.manage().window().maximize();
20 | driver.manage().deleteAllCookies();
21 | driver.manage().timeouts().pageLoadTimeout(4, TimeUnit.SECONDS);
22 | driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
23 | driver.get("https://www.flipkart.com/");
24 | Thread.sleep(2000l);
25 | driver.findElement(By.xpath("//div[@class='_2QfC02']/button")).click();
26 | driver.findElement(By.xpath("//input[@class='_3704LK']")).sendKeys("iphone");
27 | List totlList = driver.findElements(By.xpath("//div[contains(@class,'lrtEPN _17d0yO')]"));
28 |
29 | for (int i=0;i list = driver.findElements(By.xpath("//ul[contains(@class,'multiselect')]//li"));
27 |
28 | for (int i=0;i totalFrame = driver.findElements(By.tagName("iframe"));
28 | totalFrame.size();
29 | System.out.println("total frame "+totalFrame.size());
30 |
31 | // driver.switchTo().frame(0);
32 | // driver.switchTo().frame(0);
33 | driver.switchTo().frame(frame);
34 |
35 | WebElement Source = driver.findElement(By.xpath("//*[@id='draggable']"));
36 | WebElement target = driver.findElement(By.id("droppable"));
37 | Actions ac = new Actions(driver);
38 | ac.dragAndDrop(Source, target).build().perform();
39 | driver.switchTo().defaultContent();
40 | driver.findElement(By.xpath("//*[text()='Draggable']")).click();
41 |
42 |
43 | try {
44 | Thread.sleep(4000);
45 | } catch (InterruptedException e) {
46 | // TODO Auto-generated catch block
47 | e.printStackTrace();
48 | }
49 | driver.quit();
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/Java/G.java:
--------------------------------------------------------------------------------
1 | package Java;
2 |
3 | import java.util.List;
4 | import java.util.concurrent.TimeUnit;
5 |
6 | import org.openqa.selenium.By;
7 | import org.openqa.selenium.JavascriptExecutor;
8 | import org.openqa.selenium.WebDriver;
9 | import org.openqa.selenium.WebElement;
10 | import org.openqa.selenium.chrome.ChromeDriver;
11 | import org.testng.Assert;
12 | import org.testng.annotations.AfterMethod;
13 | import org.testng.annotations.BeforeMethod;
14 | import org.testng.asserts.SoftAssert;
15 |
16 | import io.github.bonigarcia.wdm.WebDriverManager;
17 |
18 | public class G {
19 |
20 |
21 | public static void main(String[] args) throws InterruptedException {
22 |
23 | WebDriverManager.chromedriver().setup();
24 | WebDriver driver = new ChromeDriver();
25 | driver.manage().window().maximize();
26 | driver.manage().deleteAllCookies();
27 | driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
28 | driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
29 | driver.get("https://www.spicejet.com/");
30 |
31 | driver.findElement(By.xpath("//*[contains(text(),'Passengers')]")).click();
32 | driver.findElement(By.xpath("(//*[@class='css-1dbjc4n r-18u37iz r-1wtj0ep r-1x0uki6'])[1]//div[@data-focusable]")).click();
33 | Thread.sleep(4000);
34 | driver.findElement(By.xpath("(//*[@class='css-1dbjc4n r-18u37iz r-1wtj0ep r-1x0uki6'])[2]//div[@data-focusable]")).click();
35 | Thread.sleep(4000);
36 | driver.findElement(By.xpath("(//*[@class='css-1dbjc4n r-18u37iz r-1wtj0ep r-1x0uki6'])[3]//div[@data-focusable]")).click();
37 | Thread.sleep(4000);
38 | driver.quit();
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | }
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | }
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/WebTable.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import java.util.List;
4 |
5 | import org.openqa.selenium.By;
6 | import org.openqa.selenium.JavascriptExecutor;
7 | import org.openqa.selenium.WebDriver;
8 | import org.openqa.selenium.WebElement;
9 | import org.openqa.selenium.chrome.ChromeDriver;
10 | import org.openqa.selenium.interactions.Actions;
11 |
12 | import io.github.bonigarcia.wdm.WebDriverManager;
13 |
14 | public class WebTable {
15 |
16 | public static void main(String[] args) throws InterruptedException {
17 |
18 |
19 |
20 |
21 | WebDriverManager.chromedriver().setup();
22 | WebDriver driver = new ChromeDriver();
23 | driver.get("https://qavbox.github.io/demo/webtable/");
24 | driver.manage().window().maximize();
25 | JavascriptExecutor js =(JavascriptExecutor)driver;
26 | Actions action = new Actions(driver);
27 | WebElement tillView = driver.findElement(By.id("table02"));
28 | js.executeScript("arguments[0].scrollIntoView();",tillView);
29 | List totallist = driver.findElements(By.xpath("//table[@id='table02']//tr//td[2]"));
30 |
31 | //js.executeScript("document.querySelector('#table02').scrollTop=200");
32 | Thread.sleep(3000);
33 | // js.executeScript("document.querySelector('#table02').scrollBy(0,400)");
34 |
35 | for(WebElement list :totallist ) {
36 | list.getText();
37 | //js.executeScript("document.querySelector('#table02').scrollTop=200");
38 | // Thread.sleep(2000);
39 | js.executeScript("document.querySelector('#table02').scrollBy(0,400)");
40 | // Thread.sleep(2000);
41 | System.out.println(list.getText());
42 | if (list.getText().equals("Senior Marketing Designer")) {
43 | // Thread.sleep(2000);
44 | action.moveToElement(list).contextClick().build().perform();
45 | Thread.sleep(2000);
46 | System.out.println(" @---->> "+"i am clicking to given element");
47 | break;
48 |
49 | }
50 | }
51 |
52 |
53 |
54 | Thread.sleep(2000);
55 | driver.quit();
56 |
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/test-output/emailable-report.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TestNG Report
6 |
7 |
8 |
9 |
10 | | Test | # Passed | # Skipped | # Retried | # Failed | Time (ms) | Included Groups | Excluded Groups |
11 | | Default suite |
12 | | Default test | 1 | 0 | 0 | 0 | 6,489 | | |
13 |
14 | | Class | Method | Start | Time (ms) |
|---|
| Default suite |
|---|
| Default test — passed |
|---|
| Selenium.BasicAuth | basicAuthUsingUri | 1666439785465 | 6436 |
15 |
16 | Default test
Selenium.BasicAuth#basicAuthUsingUri
back to summary
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/TestNG.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import org.testng.Assert;
4 | import org.testng.annotations.AfterClass;
5 | import org.testng.annotations.AfterMethod;
6 | import org.testng.annotations.AfterSuite;
7 | import org.testng.annotations.AfterTest;
8 | import org.testng.annotations.BeforeClass;
9 | import org.testng.annotations.BeforeMethod;
10 | import org.testng.annotations.BeforeSuite;
11 | import org.testng.annotations.BeforeTest;
12 | import org.testng.annotations.Test;
13 |
14 | public class TestNG {
15 |
16 |
17 | @BeforeSuite
18 | public void setup_Before_Suite() {
19 | System.out.println("inside before suite");
20 | }
21 |
22 |
23 |
24 | @BeforeTest
25 | public void setup_Before_Test() {
26 | System.out.println("inside before test");
27 | }
28 |
29 |
30 | @BeforeClass
31 | public void setup_Before_Class() {
32 | System.out.println("inside before class");
33 | }
34 |
35 |
36 | @BeforeMethod
37 | public void setup() {
38 | System.out.println("inside before method");
39 | }
40 |
41 |
42 |
43 | @Test
44 | public void dropDownTest() {
45 |
46 | System.out.println("inside test method");
47 | }
48 |
49 | @Test(groups="somke",priority=1)
50 | public void dropDownTestTwo() {
51 |
52 | System.out.println("inside test method ");
53 | }
54 | @Test(groups="somke",dependsOnMethods = "dropDownTestFour")
55 | public void dropDownTestThree() {
56 |
57 | System.out.println("inside test method #######");
58 | }
59 |
60 | @Test()
61 | public void dropDownTestFour() {
62 |
63 | System.out.println("inside test method @@@@@@ ");
64 | //Assert.assertTrue(false);
65 | }
66 |
67 |
68 | @AfterMethod
69 | public void setup_After() {
70 | System.out.println("inside after method");
71 | }
72 |
73 |
74 | @AfterClass
75 | public void setup_After_Class() {
76 | System.out.println("inside after class");
77 | }
78 |
79 | @AfterTest
80 | public void setup_After_Test() {
81 | System.out.println("inside after test");
82 | }
83 |
84 | @AfterSuite
85 | public void setup_After_Suite() {
86 | System.out.println("inside after suite");
87 | }
88 |
89 |
90 |
91 |
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/src/main/java/Selenium/Calender.java:
--------------------------------------------------------------------------------
1 | package Selenium;
2 |
3 | import java.util.List;
4 | import java.util.concurrent.TimeUnit;
5 |
6 | import org.openqa.selenium.By;
7 | import org.openqa.selenium.WebDriver;
8 | import org.openqa.selenium.WebElement;
9 | import org.openqa.selenium.chrome.ChromeDriver;
10 | import org.testng.annotations.Test;
11 |
12 | import io.github.bonigarcia.wdm.WebDriverManager;
13 |
14 | public class Calender {
15 |
16 |
17 |
18 |
19 |
20 |
21 | @Test
22 | public void getCalender() throws InterruptedException {
23 | WebDriverManager.chromedriver().setup();
24 | WebDriver driver = new ChromeDriver();
25 | driver.manage().window().maximize();
26 | driver.manage().deleteAllCookies();
27 | driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);
28 | driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
29 | driver.get("http://seleniumpractise.blogspot.com/2016/08/how-to-handle-calendar-in-selenium.html");
30 | driver.findElement(By.id("datepicker")).click();
31 |
32 | String actualYear = driver.findElement(By.className("ui-datepicker-title")).getText();
33 | // September 2022
34 | System.out.println(actualYear);
35 | String month = actualYear.split(" ")[0].trim();
36 | String year = actualYear.split(" ")[1].trim();
37 |
38 | while (!(month.equals("December") && year.equals("2025"))) {// 06/20/2023
39 | driver.findElement(By.xpath("//a[@title='Next']")).click();
40 | actualYear = driver.findElement(By.className("ui-datepicker-title")).getText();
41 | month = actualYear.split(" ")[0].trim();
42 | year = actualYear.split(" ")[1].trim();
43 |
44 | }
45 | driver.findElement(By.xpath("//a[text()='31']")).click();
46 |
47 | Thread.sleep(4000);
48 | // List dates = driver.findElements(By.cssSelector(".ui-state-default"));
49 | // for(int i=0;i
2 |
3 | TestNG: Default test
4 |
5 |
6 |
7 |
11 |
53 |
54 |
55 |
56 | Default test
57 |
58 | | Tests passed/Failed/Skipped: | 1/0/0 |
59 |
60 | | Started on: | Sat Oct 22 12:56:25 BST 2022 |
61 |
62 | | Total time: | 6 seconds (6489 ms) |
63 |
64 | | Included groups: | |
65 |
66 | | Excluded groups: | |
67 |
68 |
69 | (Hover the method name to see the test class name)
70 |
71 | | PASSED TESTS |
72 | | Test method |
73 | Exception |
74 | Time (seconds) |
75 | Instance |
76 |
77 |
78 | basicAuthUsingUri Test class: Selenium.BasicAuth |
79 | |
80 | 6 |
81 | Selenium.BasicAuth@34f5090e |
82 |
83 |
84 |