└── Practice ├── .classpath ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.m2e.core.prefs ├── data └── Output.xlsx ├── debug.log ├── drivers ├── chromedriver.exe ├── chromedriver66.exe ├── chromedriver_81.exe └── geckodriver_64 bit.exe ├── hs_err_pid2128.log ├── pom.xml ├── snaps └── Cooker.jpg ├── src └── main │ └── java │ ├── base │ └── api │ │ ├── ProjectSpecificMethods.java │ │ ├── ReadWriteExcel.java │ │ └── tempDelete.java │ ├── javaprgms │ ├── J001CountPalindrome.java │ ├── J002String.java │ ├── J003May14.java │ ├── J004May15.java │ ├── J005May18.java │ ├── J006May19.java │ ├── J007May20.java │ ├── J008May21.java │ ├── J009May26.java │ ├── J010May27.java │ ├── J011May28.java │ └── J012May29.java │ └── testCases │ ├── TC001Myntra.java │ ├── TC002Nykaa.java │ ├── TC003MakeMyTrip.java │ ├── TC004Hp.java │ ├── TC005Postman.java │ ├── TC006BigBasket.java │ ├── TC007Honda.java │ ├── TC008Pepperfry.java │ ├── TC009CrmCloud.java │ ├── TC010JustDial.java │ ├── TC011SnapDeal.java │ ├── TC012Carwale.java │ ├── TC013Shiksha.java │ ├── TC014zalando.java │ ├── TC015airbnb.java │ ├── TC016ajio.java │ └── TC017azure.java └── target └── classes ├── base └── api │ ├── ProjectSpecificMethods.class │ ├── ReadWriteExcel.class │ └── tempDelete.class ├── javaprgms ├── J001CountPalindrome.class ├── J002String.class ├── J003May14.class ├── J004May15.class ├── J005May18.class ├── J006May19.class ├── J007May20.class ├── J008May21.class ├── J009May26.class ├── J010May27.class ├── J011May28.class └── J012May29.class └── testCases ├── TC001.class ├── TC001Myntra.class ├── TC002Nykaa.class ├── TC003MakeMyTrip.class ├── TC004Hp.class ├── TC005Postman.class ├── TC006BigBasket.class ├── TC007Honda.class ├── TC008Pepperfry.class ├── TC009CrmCloud.class ├── TC010JustDial.class ├── TC011SnapDeal.class ├── TC012Carwale.class ├── TC013Shiksha.class ├── TC014zalando.class ├── TC015airbnb.class ├── TC016ajio.class └── TC017azure.class /Practice/.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 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Practice/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Practice 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 | -------------------------------------------------------------------------------- /Practice/.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.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.8 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 13 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore 14 | org.eclipse.jdt.core.compiler.release=disabled 15 | org.eclipse.jdt.core.compiler.source=1.8 16 | -------------------------------------------------------------------------------- /Practice/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Practice/data/Output.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/data/Output.xlsx -------------------------------------------------------------------------------- /Practice/debug.log: -------------------------------------------------------------------------------- 1 | [0417/154235.551:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 2 | [0417/214050.993:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 3 | [0417/233104.400:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 4 | [0417/234256.327:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 5 | [0429/231147.713:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 6 | [0501/203513.123:ERROR:prune_crash_reports.cc(35)] PruneCrashReportDatabase: Failed to get pending reports 7 | -------------------------------------------------------------------------------- /Practice/drivers/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/drivers/chromedriver.exe -------------------------------------------------------------------------------- /Practice/drivers/chromedriver66.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/drivers/chromedriver66.exe -------------------------------------------------------------------------------- /Practice/drivers/chromedriver_81.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/drivers/chromedriver_81.exe -------------------------------------------------------------------------------- /Practice/drivers/geckodriver_64 bit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/drivers/geckodriver_64 bit.exe -------------------------------------------------------------------------------- /Practice/hs_err_pid2128.log: -------------------------------------------------------------------------------- 1 | # 2 | # A fatal error has been detected by the Java Runtime Environment: 3 | # 4 | # Internal Error (0xc06d007e), pid=2128, tid=0x0000000000000dc4 5 | # 6 | # JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11) 7 | # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode windows-amd64 compressed oops) 8 | # Problematic frame: 9 | # C [KERNELBASE.dll+0x88dc] 10 | # 11 | # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows 12 | # 13 | # If you would like to submit a bug report, please visit: 14 | # http://bugreport.java.com/bugreport/crash.jsp 15 | # The crash happened outside the Java Virtual Machine in native code. 16 | # See problematic frame for where to report the bug. 17 | # 18 | 19 | --------------- T H R E A D --------------- 20 | 21 | Current thread (0x00000000020c3800): JavaThread "main" [_thread_in_native, id=3524, stack(0x0000000001fc0000,0x00000000020c0000)] 22 | 23 | siginfo: ExceptionCode=0xc06d007e, ExceptionInformation=0x00000000020b9c10 24 | 25 | Registers: 26 | RAX=0x000000000000000e, RBX=0x0000000000000000, RCX=0x0000000000610000, RDX=0x000000000061e420 27 | RSP=0x00000000020b9b10, RBP=0x00000000020b9c68, RSI=0x000000005d5b3178, RDI=0x0000000000000000 28 | R8 =0x00007ff8c30000c3, R9 =0x00000000003e0000, R10=0x0000000100000000, R11=0x0000000000000020 29 | R12=0x0000000000000004, R13=0x000000005d5b6370, R14=0x000000005d5b6108, R15=0x000000005d5b33e0 30 | RIP=0x00007ff8591888dc, EFLAGS=0x0000000000000206 31 | 32 | Top of Stack: (sp=0x00000000020b9b10) 33 | 0x00000000020b9b10: 000000005d5b33e0 0000000000000000 34 | 0x00000000020b9b20: 000000005d5b3178 0000000000000000 35 | 0x00000000020b9b30: 00000000c06d007e 0000000000000000 36 | 0x00000000020b9b40: 00007ff8591888dc 00007ff800000001 37 | 0x00000000020b9b50: 00000000020b9c10 000000000063a890 38 | 0x00000000020b9b60: 000000005d5b6108 0000000000000000 39 | 0x00000000020b9b70: 0000000000000000 00007ff859189223 40 | 0x00000000020b9b80: 0000000000000000 000000005d5b3178 41 | 0x00000000020b9b90: 000000005d5b3178 0000000000000000 42 | 0x00000000020b9ba0: 0000000000000000 0000000000000000 43 | 0x00000000020b9bb0: 000000005d5b2640 00007ff85b4830ca 44 | 0x00000000020b9bc0: 0000000000000000 0000000000000370 45 | 0x00000000020b9bd0: 00003448a4908b87 00007ff85bc7098d 46 | 0x00000000020b9be0: 0000000000000000 000000005d5aed6f 47 | 0x00000000020b9bf0: 0000000000000000 000000005d5b3178 48 | 0x00000000020b9c00: 0000000001f404c0 00000000020b9cf8 49 | 50 | Instructions: (pc=0x00007ff8591888dc) 51 | 0x00007ff8591888bc: 44 3b c0 44 0f 47 c0 44 89 44 24 38 49 c1 e0 03 52 | 0x00007ff8591888cc: e8 73 8d ff ff 48 8d 4c 24 20 ff 15 94 0d 10 00 53 | 0x00007ff8591888dc: 48 8b 8c 24 c0 00 00 00 48 33 cc e8 54 8b ff ff 54 | 0x00007ff8591888ec: 48 81 c4 d8 00 00 00 c3 90 90 90 90 90 90 90 90 55 | 56 | 57 | Register to memory mapping: 58 | 59 | RAX=0x000000000000000e is an unknown value 60 | RBX=0x0000000000000000 is an unknown value 61 | RCX=0x0000000000610000 is an unknown value 62 | RDX=0x000000000061e420 is an unknown value 63 | RSP=0x00000000020b9b10 is pointing into the stack for thread: 0x00000000020c3800 64 | RBP=0x00000000020b9c68 is pointing into the stack for thread: 0x00000000020c3800 65 | RSI=0x000000005d5b3178 is an unknown value 66 | RDI=0x0000000000000000 is an unknown value 67 | R8 =0x00007ff8c30000c3 is an unknown value 68 | R9 =0x00000000003e0000 is an unknown value 69 | R10=0x0000000100000000 is pointing into metadata 70 | R11=0x0000000000000020 is an unknown value 71 | R12=0x0000000000000004 is an unknown value 72 | R13=0x000000005d5b6370 is an unknown value 73 | R14=0x000000005d5b6108 is an unknown value 74 | R15=0x000000005d5b33e0 is an unknown value 75 | 76 | 77 | Stack: [0x0000000001fc0000,0x00000000020c0000], sp=0x00000000020b9b10, free space=998k 78 | Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) 79 | C [KERNELBASE.dll+0x88dc] 80 | 81 | Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) 82 | j java.net.NetworkInterface.getAll()[Ljava/net/NetworkInterface;+0 83 | j java.net.NetworkInterface.getNetworkInterfaces()Ljava/util/Enumeration;+0 84 | j javax.crypto.JarVerifier.addNetworkAdapterInfo(Ljava/security/MessageDigest;)V+0 85 | j javax.crypto.JarVerifier.getSystemEntropy()[B+92 86 | j javax.crypto.JarVerifier.testSignatures(Ljava/security/cert/X509Certificate;Ljava/security/cert/CertificateFactory;)V+3 87 | j javax.crypto.JarVerifier.access$400(Ljava/security/cert/X509Certificate;Ljava/security/cert/CertificateFactory;)V+2 88 | j javax.crypto.JarVerifier$1.run()Ljava/lang/Void;+80 89 | j javax.crypto.JarVerifier$1.run()Ljava/lang/Object;+1 90 | v ~StubRoutines::call_stub 91 | j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;+0 92 | j javax.crypto.JarVerifier.()V+7 93 | v ~StubRoutines::call_stub 94 | j javax.crypto.JceSecurity.loadPolicies(Ljava/io/File;Ljavax/crypto/CryptoPermissions;Ljavax/crypto/CryptoPermissions;)V+146 95 | j javax.crypto.JceSecurity.setupJurisdictionPolicies()V+344 96 | j javax.crypto.JceSecurity.access$000()V+0 97 | j javax.crypto.JceSecurity$1.run()Ljava/lang/Object;+0 98 | v ~StubRoutines::call_stub 99 | j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;+0 100 | j javax.crypto.JceSecurity.()V+55 101 | v ~StubRoutines::call_stub 102 | j javax.crypto.JceSecurityManager.()V+31 103 | v ~StubRoutines::call_stub 104 | j javax.crypto.Cipher.getConfiguredPermission(Ljava/lang/String;)Ljavax/crypto/CryptoPermission;+17 105 | j javax.crypto.Cipher.getMaxAllowedKeyLength(Ljava/lang/String;)I+1 106 | j sun.security.ssl.CipherSuite$BulkCipher.isUnlimited(ILjava/lang/String;)Z+13 107 | j sun.security.ssl.CipherSuite$BulkCipher.(Ljava/lang/String;Lsun/security/ssl/CipherSuite$CipherType;IIIZ)V+109 108 | j sun.security.ssl.CipherSuite.()V+150 109 | v ~StubRoutines::call_stub 110 | j sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(Lsun/security/ssl/ProtocolList;Z)Lsun/security/ssl/CipherSuiteList;+10 111 | j sun.security.ssl.SSLContextImpl.access$100(Lsun/security/ssl/ProtocolList;Z)Lsun/security/ssl/CipherSuiteList;+2 112 | j sun.security.ssl.SSLContextImpl$AbstractTLSContext.()V+195 113 | v ~StubRoutines::call_stub 114 | j java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Class;+0 115 | j java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class;+11 116 | j java.security.Provider$Service.getImplClass()Ljava/lang/Class;+44 117 | j java.security.Provider$Service.newInstance(Ljava/lang/Object;)Ljava/lang/Object;+146 118 | j sun.security.jca.GetInstance.getInstance(Ljava/security/Provider$Service;Ljava/lang/Class;)Lsun/security/jca/GetInstance$Instance;+2 119 | j sun.security.jca.GetInstance.getInstance(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)Lsun/security/jca/GetInstance$Instance;+56 120 | j javax.net.ssl.SSLContext.getInstance(Ljava/lang/String;)Ljavax/net/ssl/SSLContext;+5 121 | j okhttp3.internal.platform.Platform.getSSLContext()Ljavax/net/ssl/SSLContext;+24 122 | j okhttp3.OkHttpClient.newSslSocketFactory(Ljavax/net/ssl/X509TrustManager;)Ljavax/net/ssl/SSLSocketFactory;+3 123 | j okhttp3.OkHttpClient.(Lokhttp3/OkHttpClient$Builder;)V+195 124 | j okhttp3.OkHttpClient$Builder.build()Lokhttp3/OkHttpClient;+5 125 | j org.openqa.selenium.remote.internal.OkHttpClient$Factory$1.createClient(Ljava/net/URL;)Lorg/openqa/selenium/remote/http/HttpClient;+139 126 | j org.openqa.selenium.remote.http.HttpClient$Factory.createClient(Ljava/net/URL;)Lorg/openqa/selenium/remote/http/HttpClient;+7 127 | j org.openqa.selenium.remote.HttpCommandExecutor.(Ljava/util/Map;Ljava/net/URL;Lorg/openqa/selenium/remote/http/HttpClient$Factory;)V+68 128 | j org.openqa.selenium.remote.HttpCommandExecutor.(Ljava/util/Map;Ljava/net/URL;)V+6 129 | j org.openqa.selenium.remote.service.DriverCommandExecutor.(Lorg/openqa/selenium/remote/service/DriverService;Ljava/util/Map;)V+6 130 | j org.openqa.selenium.chrome.ChromeDriverCommandExecutor.(Lorg/openqa/selenium/remote/service/DriverService;)V+5 131 | j org.openqa.selenium.chrome.ChromeDriver.(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/Capabilities;)V+6 132 | j org.openqa.selenium.chrome.ChromeDriver.(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/chrome/ChromeOptions;)V+3 133 | j org.openqa.selenium.chrome.ChromeDriver.(Lorg/openqa/selenium/chrome/ChromeOptions;)V+5 134 | j base.api.ProjectSpecificMethods.launch(Ljava/lang/String;)V+57 135 | j testCases.TC014zalando.main([Ljava/lang/String;)V+21 136 | v ~StubRoutines::call_stub 137 | 138 | --------------- P R O C E S S --------------- 139 | 140 | Java Threads: ( => current thread ) 141 | 0x00000000145bf800 JavaThread "Service Thread" daemon [_thread_blocked, id=1524, stack(0x0000000015760000,0x0000000015860000)] 142 | 0x000000001454d800 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=4752, stack(0x0000000015660000,0x0000000015760000)] 143 | 0x000000001454b800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=5628, stack(0x0000000015560000,0x0000000015660000)] 144 | 0x000000001454a000 JavaThread "Attach Listener" daemon [_thread_blocked, id=5876, stack(0x0000000015460000,0x0000000015560000)] 145 | 0x0000000014547000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4400, stack(0x0000000015360000,0x0000000015460000)] 146 | 0x0000000014538800 JavaThread "Finalizer" daemon [_thread_blocked, id=5496, stack(0x0000000015180000,0x0000000015280000)] 147 | 0x00000000021b0800 JavaThread "Reference Handler" daemon [_thread_blocked, id=2736, stack(0x0000000015080000,0x0000000015180000)] 148 | =>0x00000000020c3800 JavaThread "main" [_thread_in_native, id=3524, stack(0x0000000001fc0000,0x00000000020c0000)] 149 | 150 | Other Threads: 151 | 0x0000000014516000 VMThread [stack: 0x0000000014f80000,0x0000000015080000] [id=4236] 152 | 0x00000000145db800 WatcherThread [stack: 0x0000000015860000,0x0000000015960000] [id=1128] 153 | 154 | VM state:not at safepoint (normal execution) 155 | 156 | VM Mutex/Monitor currently owned by a thread: None 157 | 158 | Heap: 159 | PSYoungGen total 18944K, used 15743K [0x00000000eb400000, 0x00000000ec900000, 0x0000000100000000) 160 | eden space 16384K, 96% used [0x00000000eb400000,0x00000000ec35fcb0,0x00000000ec400000) 161 | from space 2560K, 0% used [0x00000000ec680000,0x00000000ec680000,0x00000000ec900000) 162 | to space 2560K, 0% used [0x00000000ec400000,0x00000000ec400000,0x00000000ec680000) 163 | ParOldGen total 44032K, used 0K [0x00000000c1c00000, 0x00000000c4700000, 0x00000000eb400000) 164 | object space 44032K, 0% used [0x00000000c1c00000,0x00000000c1c00000,0x00000000c4700000) 165 | Metaspace used 8225K, capacity 8422K, committed 8576K, reserved 1056768K 166 | class space used 953K, capacity 1063K, committed 1152K, reserved 1048576K 167 | 168 | Card table byte_map: [0x0000000011580000,0x0000000011780000] byte_map_base: 0x0000000010f72000 169 | 170 | Marking Bits: (ParMarkBitMap*) 0x000000005df208c0 171 | Begin Bits: [0x0000000011ad0000, 0x0000000012a60000) 172 | End Bits: [0x0000000012a60000, 0x00000000139f0000) 173 | 174 | Polling page: 0x0000000001e50000 175 | 176 | CodeCache: size=245760Kb used=3118Kb max_used=3129Kb free=242641Kb 177 | bounds [0x00000000021c0000, 0x00000000024d0000, 0x00000000111c0000] 178 | total_blobs=1142 nmethods=811 adapters=245 179 | compilation: enabled 180 | 181 | Compilation events (10 events): 182 | Event: 1.830 Thread 0x000000001454d800 807 3 sun.nio.cs.SingleByte$Encoder::encode (32 bytes) 183 | Event: 1.830 Thread 0x000000001454d800 nmethod 807 0x00000000024c1310 code [0x00000000024c1480, 0x00000000024c1690] 184 | Event: 1.830 Thread 0x000000001454d800 808 3 java.util.Hashtable$Enumerator::hasMoreElements (53 bytes) 185 | Event: 1.830 Thread 0x000000001454d800 nmethod 808 0x00000000024cb150 code [0x00000000024cb2c0, 0x00000000024cb590] 186 | Event: 1.830 Thread 0x000000001454d800 809 3 java.util.Hashtable$Enumerator::nextElement (111 bytes) 187 | Event: 1.831 Thread 0x000000001454b800 811 4 sun.nio.cs.SingleByte$Encoder::encode (32 bytes) 188 | Event: 1.831 Thread 0x000000001454d800 nmethod 809 0x00000000024cb6d0 code [0x00000000024cb860, 0x00000000024cbcc8] 189 | Event: 1.831 Thread 0x000000001454d800 810 3 java.util.Properties::getProperty (46 bytes) 190 | Event: 1.831 Thread 0x000000001454d800 nmethod 810 0x00000000024cbed0 code [0x00000000024cc060, 0x00000000024cc578] 191 | Event: 1.833 Thread 0x000000001454b800 nmethod 811 0x00000000024cf390 code [0x00000000024cf4e0, 0x00000000024cf5f8] 192 | 193 | GC Heap History (0 events): 194 | No events 195 | 196 | Deoptimization events (6 events): 197 | Event: 0.576 Thread 0x00000000020c3800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000232b2f4 method=java.lang.String.indexOf([CII[CIII)I @ 134 198 | Event: 0.920 Thread 0x00000000020c3800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000231b3c8 method=java.lang.String.startsWith(Ljava/lang/String;I)Z @ 25 199 | Event: 1.643 Thread 0x00000000020c3800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000248e530 method=java.io.ByteArrayInputStream.read([BII)I @ 63 200 | Event: 1.817 Thread 0x00000000020c3800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002458550 method=java.io.ByteArrayInputStream.read()I @ 8 201 | Event: 1.822 Thread 0x00000000020c3800 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000024c4314 method=java.util.regex.Pattern$BmpCharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 31 202 | Event: 1.822 Thread 0x00000000020c3800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000024c42dc method=java.util.regex.Pattern$BmpCharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 5 203 | 204 | Classes redefined (0 events): 205 | No events 206 | 207 | Internal exceptions (10 events): 208 | Event: 0.153 Thread 0x00000000020c3800 Exception (0x00000000eb407cb0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot 209 | Event: 0.153 Thread 0x00000000020c3800 Exception (0x00000000eb407f98) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prim 210 | Event: 0.906 Thread 0x00000000020c3800 Exception (0x00000000eb9e8ac0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 211 | Event: 0.906 Thread 0x00000000020c3800 Exception (0x00000000eb9e8eb8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 212 | Event: 0.907 Thread 0x00000000020c3800 Exception (0x00000000eb9ecd10) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 213 | Event: 0.907 Thread 0x00000000020c3800 Exception (0x00000000eb9ed108) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 214 | Event: 0.964 Thread 0x00000000020c3800 Exception (0x00000000eba62d00) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 215 | Event: 0.964 Thread 0x00000000020c3800 Exception (0x00000000eba630f8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\jvm.cpp, line 1435] 216 | Event: 1.057 Thread 0x00000000020c3800 Exception (0x00000000ebb52e58) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\methodHandles.cpp, line 1167] 217 | Event: 1.071 Thread 0x00000000020c3800 Exception (0x00000000ebb60380) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u171\10807\hotspot\src\share\vm\prims\methodHandles.cpp, line 1167] 218 | 219 | Events (10 events): 220 | Event: 1.829 loading class java/util/Hashtable$KeySet 221 | Event: 1.829 loading class java/util/Hashtable$KeySet done 222 | Event: 1.832 loading class java/net/NetworkInterface 223 | Event: 1.832 loading class java/net/NetworkInterface done 224 | Event: 1.833 loading class java/net/NetworkInterface$1 225 | Event: 1.833 loading class java/net/NetworkInterface$1 done 226 | Event: 1.833 loading class java/net/InterfaceAddress 227 | Event: 1.833 loading class java/net/InterfaceAddress done 228 | Event: 1.833 loading class java/net/DefaultInterface 229 | Event: 1.833 loading class java/net/DefaultInterface done 230 | 231 | 232 | Dynamic libraries: 233 | 0x00007ff6c2e70000 - 0x00007ff6c2ea7000 C:\Program Files\Java\jre1.8.0_171\bin\javaw.exe 234 | 0x00007ff85bc40000 - 0x00007ff85bded000 C:\Windows\SYSTEM32\ntdll.dll 235 | 0x00007ff85b480000 - 0x00007ff85b5bf000 C:\Windows\system32\KERNEL32.DLL 236 | 0x00007ff859180000 - 0x00007ff859295000 C:\Windows\system32\KERNELBASE.dll 237 | 0x00007ff857930000 - 0x00007ff8579be000 C:\Windows\system32\apphelp.dll 238 | 0x00007ff850930000 - 0x00007ff850985000 C:\Windows\AppPatch\AppPatch64\AcGenral.DLL 239 | 0x00007ff85b830000 - 0x00007ff85b8da000 C:\Windows\system32\msvcrt.dll 240 | 0x00007ff8592a0000 - 0x00007ff8592ce000 C:\Windows\system32\SspiCli.dll 241 | 0x00007ff85ae20000 - 0x00007ff85ae74000 C:\Windows\system32\SHLWAPI.dll 242 | 0x00007ff85b9b0000 - 0x00007ff85bb27000 C:\Windows\system32\USER32.dll 243 | 0x00007ff8595a0000 - 0x00007ff859734000 C:\Windows\system32\ole32.dll 244 | 0x00007ff8597a0000 - 0x00007ff85accb000 C:\Windows\system32\SHELL32.dll 245 | 0x00007ff858330000 - 0x00007ff858351000 C:\Windows\SYSTEM32\USERENV.dll 246 | 0x00007ff85bb90000 - 0x00007ff85bc3a000 C:\Windows\system32\ADVAPI32.dll 247 | 0x00007ff8523b0000 - 0x00007ff8523ce000 C:\Windows\SYSTEM32\MPR.dll 248 | 0x00007ff85ae90000 - 0x00007ff85afd0000 C:\Windows\system32\RPCRT4.dll 249 | 0x00007ff85b420000 - 0x00007ff85b479000 C:\Windows\SYSTEM32\sechost.dll 250 | 0x00007ff8592d0000 - 0x00007ff8594e0000 C:\Windows\SYSTEM32\combase.dll 251 | 0x00007ff85acd0000 - 0x00007ff85ae1c000 C:\Windows\system32\GDI32.dll 252 | 0x00007ff858d70000 - 0x00007ff858d85000 C:\Windows\SYSTEM32\profapi.dll 253 | 0x00007ff857150000 - 0x00007ff857202000 C:\Windows\SYSTEM32\SHCORE.dll 254 | 0x00007ff859740000 - 0x00007ff859776000 C:\Windows\system32\IMM32.DLL 255 | 0x00007ff85b190000 - 0x00007ff85b2e2000 C:\Windows\system32\MSCTF.dll 256 | 0x00007ff856b20000 - 0x00007ff856d9b000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.9600.19394_none_62486577ecb635cf\COMCTL32.dll 257 | 0x000000005d620000 - 0x000000005d6f2000 C:\Program Files\Java\jre1.8.0_171\bin\msvcr100.dll 258 | 0x000000005d700000 - 0x000000005dfa0000 C:\Program Files\Java\jre1.8.0_171\bin\server\jvm.dll 259 | 0x00007ff851bc0000 - 0x00007ff851bc9000 C:\Windows\SYSTEM32\WSOCK32.dll 260 | 0x00007ff855280000 - 0x00007ff8552a2000 C:\Windows\SYSTEM32\WINMM.dll 261 | 0x00007ff851ea0000 - 0x00007ff851eaa000 C:\Windows\SYSTEM32\VERSION.dll 262 | 0x00007ff85b5d0000 - 0x00007ff85b5d7000 C:\Windows\system32\PSAPI.DLL 263 | 0x00007ff85b2f0000 - 0x00007ff85b34a000 C:\Windows\system32\WS2_32.dll 264 | 0x00007ff853b70000 - 0x00007ff853b9a000 C:\Windows\SYSTEM32\WINMMBASE.dll 265 | 0x00007ff85b350000 - 0x00007ff85b359000 C:\Windows\system32\NSI.dll 266 | 0x00007ff859080000 - 0x00007ff8590cf000 C:\Windows\SYSTEM32\cfgmgr32.dll 267 | 0x00007ff857b80000 - 0x00007ff857ba8000 C:\Windows\SYSTEM32\DEVOBJ.dll 268 | 0x000000005d610000 - 0x000000005d61f000 C:\Program Files\Java\jre1.8.0_171\bin\verify.dll 269 | 0x000000005d5e0000 - 0x000000005d609000 C:\Program Files\Java\jre1.8.0_171\bin\java.dll 270 | 0x000000005d5c0000 - 0x000000005d5d6000 C:\Program Files\Java\jre1.8.0_171\bin\zip.dll 271 | 0x000000005d5a0000 - 0x000000005d5ba000 C:\Program Files\Java\jre1.8.0_171\bin\net.dll 272 | 0x00007ff8585a0000 - 0x00007ff8585f9000 C:\Windows\system32\mswsock.dll 273 | 0x00007ff8583a0000 - 0x00007ff858444000 C:\Windows\SYSTEM32\DNSAPI.dll 274 | 0x00007ff848ad0000 - 0x00007ff848ada000 C:\Windows\System32\rasadhlp.dll 275 | 0x00007ff8547d0000 - 0x00007ff85483b000 C:\Windows\System32\fwpuclnt.dll 276 | 0x000000005d550000 - 0x000000005d574000 C:\Program Files\Java\jre1.8.0_171\bin\sunec.dll 277 | 0x000000005d540000 - 0x000000005d54b000 C:\Program Files\Java\jre1.8.0_171\bin\sunmscapi.dll 278 | 0x00007ff858e40000 - 0x00007ff85901f000 C:\Windows\system32\CRYPT32.dll 279 | 0x00007ff858e20000 - 0x00007ff858e31000 C:\Windows\system32\MSASN1.dll 280 | 281 | VM Arguments: 282 | jvm_args: -Dfile.encoding=Cp1252 283 | java_command: testCases.TC014zalando 284 | java_class_path (initial): E:\Selenium\Projects\Practice\target\classes;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;C:\Users\BM\.m2\repository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;C:\Users\BM\.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\BM\.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\BM\.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\BM\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\BM\.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\BM\.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\BM\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\BM\.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\BM\.m2\repository\com\squareup\okhttp3\ 285 | Launcher Type: SUN_STANDARD 286 | 287 | Environment Variables: 288 | PATH=C:/Program Files/Java/jre1.8.0_171/bin/server;C:/Program Files/Java/jre1.8.0_171/bin;C:/Program Files/Java/jre1.8.0_171/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_171\bin;E:\Selenium\TestLeaf\eclipse; 289 | USERNAME=BM 290 | OS=Windows_NT 291 | PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD 292 | 293 | 294 | 295 | --------------- S Y S T E M --------------- 296 | 297 | OS: Windows 8.1 , 64 bit Build 9600 (6.3.9600.19538) 298 | 299 | CPU:total 2 (initial active 2) (2 cores per cpu, 1 threads per core) family 21 model 112 stepping 0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1 300 | 301 | Memory: 4k page, physical 4078968k(237596k free), swap 16661880k(4796k free) 302 | 303 | vm_info: Java HotSpot(TM) 64-Bit Server VM (25.171-b11) for windows-amd64 JRE (1.8.0_171-b11), built on Mar 28 2018 16:06:12 by "java_re" with MS VC++ 10.0 (VS2010) 304 | 305 | time: Tue May 05 08:33:43 2020 306 | elapsed time: 2 seconds (0d 0h 0m 2s) 307 | 308 | -------------------------------------------------------------------------------- /Practice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | Selenium 4 | Practice 5 | 0.0.1-SNAPSHOT 6 | 7 | 8 | org.seleniumhq.selenium 9 | selenium-java 10 | 3.141.59 11 | 12 | 13 | org.testng 14 | testng 15 | 7.0.0 16 | 17 | 18 | org.apache.poi 19 | poi 20 | 4.1.0 21 | 22 | 23 | org.apache.poi 24 | poi-ooxml 25 | 4.1.0 26 | 27 | 28 | com.aventstack 29 | extentreports 30 | 3.1.5 31 | 32 | 33 | org.apache.commons 34 | commons-io 35 | 1.3.2 36 | 37 | 38 | io.cucumber 39 | cucumber-testng 40 | 4.3.1 41 | 42 | 43 | io.cucumber 44 | cucumber-java 45 | 4.3.1 46 | 47 | 48 | -------------------------------------------------------------------------------- /Practice/snaps/Cooker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/snaps/Cooker.jpg -------------------------------------------------------------------------------- /Practice/src/main/java/base/api/ProjectSpecificMethods.java: -------------------------------------------------------------------------------- 1 | package base.api; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import org.openqa.selenium.JavascriptExecutor; 8 | import org.openqa.selenium.WebElement; 9 | import org.openqa.selenium.chrome.ChromeDriver; 10 | import org.openqa.selenium.chrome.ChromeOptions; 11 | import org.openqa.selenium.interactions.Actions; 12 | import org.openqa.selenium.remote.RemoteWebDriver; 13 | 14 | public class ProjectSpecificMethods { 15 | public static ChromeOptions options; 16 | public static RemoteWebDriver driver; 17 | public static Actions builder; 18 | 19 | public void launch(String url){ 20 | System.out.println(" *** Program Starts ***"); 21 | 22 | // --- some important commands 23 | // taskkill /F /IM chromedriver.exe 24 | // setTimeout(function(){debugger;},5000) 25 | 26 | 27 | // --- Disabling chrome notifications 28 | options = new ChromeOptions(); 29 | options.addArguments("--disable-notifications"); 30 | System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver_81.exe"); 31 | System.setProperty("webdriver.chrome.silentOutput", "true"); 32 | driver = new ChromeDriver(options); 33 | // driver.get("http://leaftaps.com/opentaps/control/login"); 34 | driver.get(url); 35 | driver.manage().window().maximize(); 36 | driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 37 | 38 | // --- Creating actions object 39 | builder = new Actions(driver); 40 | // --- Creating wait object 41 | // wait = new WebDriverWait(driver,30); 42 | 43 | } 44 | 45 | public void killprocess(boolean tkchromedriver, boolean tkchrome, boolean temp) throws IOException 46 | { 47 | // To kill choromedriver.exe at start of execution 48 | if (tkchromedriver) { 49 | Runtime.getRuntime().exec("taskkill /F /IM chromedriver_81.exe"); 50 | System.out.println("Deleted all chromedriver instances..."); 51 | } 52 | if (tkchrome) { 53 | Runtime.getRuntime().exec("taskkill /F /IM chrome.exe"); 54 | System.out.println("Deleted all chrome instances..."); 55 | } 56 | // --- To delete temp files --- 57 | if (temp) { 58 | String filePath = "C:\\Users\\BM\\AppData\\Local\\Temp"; 59 | // Creating the File object 60 | File file = new File(filePath); 61 | tempDelete tmp = new tempDelete(); 62 | tmp.deleteFolder(file); 63 | System.out.println("Deleted %temp% folder ..."); 64 | } 65 | } 66 | 67 | public static void highlighter(WebElement ele) { 68 | JavascriptExecutor js = (JavascriptExecutor) driver; 69 | js.executeScript("argument[0].setAttribute('style','border: 2px solid blue;');", ele); 70 | } 71 | public static void dehighlighter(WebElement ele) { 72 | JavascriptExecutor js = (JavascriptExecutor) driver; 73 | js.executeScript("argument[0].setAttribute('style','');", ele); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Practice/src/main/java/base/api/ReadWriteExcel.java: -------------------------------------------------------------------------------- 1 | package base.api; 2 | 3 | import java.io.File; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | 7 | import org.apache.poi.ss.usermodel.CellType; 8 | import org.apache.poi.xssf.usermodel.XSSFCell; 9 | import org.apache.poi.xssf.usermodel.XSSFRow; 10 | import org.apache.poi.xssf.usermodel.XSSFSheet; 11 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; 12 | 13 | public class ReadWriteExcel { 14 | 15 | // public String[][] readExcel(String excelName) throws IOException { 16 | public static void main(String[] args) throws IOException { 17 | // TODO Auto-generated method stub 18 | 19 | String excelName = "Output"; 20 | // XSSFWorkbook wBook = new XSSFWorkbook("./data/TC001.xlsx"); 21 | String flname = "./data/" + excelName + ".xlsx"; 22 | XSSFWorkbook wBook = new XSSFWorkbook(flname); 23 | XSSFSheet sheet = wBook.getSheet("Sheet1"); 24 | 25 | //Row Count 26 | int rowCount = sheet.getLastRowNum(); 27 | System.out.println("Row Count : " + rowCount); 28 | 29 | //Cell count 30 | short columnCount = sheet.getRow(0).getLastCellNum(); 31 | System.out.println("Column Count : " + columnCount); 32 | 33 | // String[][] data = new String[rowCount][columnCount]; 34 | //neglecting header so starting from 1 35 | // Row iterator 36 | 37 | for (int i = 1; i <= rowCount; i++) { 38 | 39 | //Row 40 | XSSFRow firstRow = sheet.getRow(i); 41 | 42 | //Column iterator 43 | int j; 44 | for ( j = 0; j < columnCount; j++) { 45 | //Column 46 | XSSFCell cell = firstRow.getCell(j); 47 | // Read data 48 | 49 | CellType cellType = cell.getCellType(); 50 | if (cellType.equals(CellType.NUMERIC)) 51 | { 52 | double val = cell.getNumericCellValue(); 53 | System.out.println(val); 54 | } 55 | else 56 | { 57 | String value = cell.getStringCellValue(); 58 | System.out.print(value + " --- "); 59 | } 60 | 61 | // data [i-1][j] = value; 62 | 63 | } 64 | System.out.println(); 65 | // firstRow.createCell(2).setCellValue("row : " +i + " column : " + (j+1)); 66 | // FileOutputStream fos = new FileOutputStream(flname); 67 | // wBook.write(fos); 68 | } 69 | // wBook.close(); 70 | // return data; 71 | //read filename from folder 72 | String downloadPath ="C:\\Users\\BM\\Downloads\\"; 73 | File dir = new File(downloadPath); 74 | File[] dir_contents = dir.listFiles(); 75 | String fileName = "ExportedEstimate (1).xlsx"; 76 | for (int i = 0; i < dir_contents.length; i++) { 77 | if (dir_contents[i].getName().equals(fileName)) 78 | System.out.println(dir_contents[i].getName()); 79 | } 80 | 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Practice/src/main/java/base/api/tempDelete.java: -------------------------------------------------------------------------------- 1 | package base.api; 2 | 3 | import java.io.File; 4 | 5 | public class tempDelete { 6 | 7 | public static void deleteFolder(File file){ 8 | for (File subFile : file.listFiles()) { 9 | if(subFile.isDirectory()) { 10 | deleteFolder(subFile); 11 | } else { 12 | subFile.delete(); 13 | } 14 | } 15 | file.delete(); 16 | } 17 | public static void main(String args[]) { 18 | String filePath = "C:\\Users\\BM\\AppData\\Local\\Temp"; 19 | //Creating the File object 20 | File file = new File(filePath); 21 | deleteFolder(file); 22 | System.out.println("Files deleted........"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J001CountPalindrome.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | public class J001CountPalindrome { 4 | 5 | public static void main(String[] args) { 6 | 7 | //-------------------------------------------------------------------------------------------- 8 | //1st Program 9 | //-------------------------------------------------------------------------------------------- 10 | String inpt = "You have no choice other than following me"; 11 | char[] a1 = inpt.toCharArray(); 12 | int cnt = 0; 13 | for (int i = 0; i < a1.length ; i++ ) 14 | { 15 | if (a1[i] == 'o') 16 | { 17 | cnt = cnt +1; 18 | } 19 | } 20 | System.out.println("Occurance if o is : "+ cnt); 21 | 22 | //replace all characters except o - 2nd approach 23 | String rep = inpt.replaceAll("[^o]", ""); 24 | System.out.println("Occurance using regular expression : "+rep.length()); 25 | 26 | //-------------------------------------------------------------------------------------------- 27 | //2nd Program 28 | //-------------------------------------------------------------------------------------------- 29 | String inpt1 = "malayalam"; 30 | String inpt2 = "testleaf"; 31 | char[] a2 = inpt1.toCharArray(); 32 | char[] a3 = inpt2.toCharArray(); 33 | String tmp = ""; 34 | String tmp1 = ""; 35 | 36 | for (int i =(a2.length-1) ; i >= 0 ; i -- ) 37 | { 38 | tmp += a2[i]; 39 | } 40 | System.out.println("tmp is : "+ tmp); 41 | for (int i =(a3.length -1) ; i >= 0 ; i -- ) 42 | { 43 | tmp1 += a3[i]; 44 | } 45 | System.out.println("tmp1 is : "+ tmp1); 46 | // if (inpt1.contentEquals(tmp)) System.out.println("Palindrome : "+ inpt1); 47 | // else System.out.println("Not Palindrome : "+ inpt1); 48 | System.out.println(inpt1.contentEquals(tmp)?"Palindrome :"+inpt1:"Not Palindrome : "+inpt1); 49 | 50 | if (inpt2.contentEquals(tmp1)) System.out.println("Palindrome : "+ inpt2); 51 | else System.out.println("Not Palindrome : "+ inpt2); 52 | 53 | // 2nd approach - using StringBuffer 54 | StringBuffer i1 = new StringBuffer(inpt1); 55 | String rev = i1.reverse().toString(); 56 | System.out.println(inpt1.contentEquals(rev)?"Palindrome :"+inpt1:"Not Palindrome : "+inpt1); 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J002String.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | public class J002String { 4 | 5 | public static void main(String[] args) { 6 | 7 | // 1st Program 8 | String inpt = "asdf1qwer9as8d7"; 9 | int sum = 0; 10 | 11 | for (int i =0 ; i < inpt.length();i++) 12 | { 13 | if (Character.isDigit(inpt.charAt(i))) 14 | { 15 | sum += Integer.parseInt(String.valueOf(inpt.charAt(i))); 16 | } 17 | } 18 | System.out.println("Program 1"); 19 | System.out.println("Input : "+inpt); 20 | System.out.println("Sum is : "+sum); 21 | System.out.println(); 22 | 23 | //2nd Program 24 | String inpt1 = "When the world realise its own mistake, corona will dissolve automatically"; 25 | String[] arr1 = inpt1.split(" "); 26 | String out = ""; 27 | for (int i = 0; i < arr1.length;i++) 28 | { 29 | if (i % 2 == 0) out = out + arr1[i] + " "; 30 | else 31 | { 32 | StringBuffer i1 = new StringBuffer(arr1[i]); 33 | String rev = i1.reverse().toString(); 34 | out = out + rev + " " ; 35 | } 36 | 37 | } 38 | System.out.println("Program 2"); 39 | System.out.println(inpt1); 40 | System.out.println(out); 41 | System.out.println(); 42 | 43 | //3rd Program 44 | String inpt2 = "1. It is Work from Home not Work for Home"; 45 | int num = 0; 46 | int up = 0; 47 | int low = 0; 48 | int spc = 0; 49 | int otr = 0; 50 | for (int i =0 ; i < inpt2.length();i++) 51 | { 52 | if (Character.isDigit(inpt2.charAt(i))) num ++; 53 | else if (Character.isUpperCase(inpt2.charAt(i))) up++; 54 | else if (Character.isLowerCase(inpt2.charAt(i))) low++; 55 | else if (inpt2.charAt(i)==' ') spc++; 56 | else otr++; 57 | } 58 | System.out.println("Program 3"); 59 | System.out.println("Input : "+inpt2); 60 | System.out.println("Count of Numbers : " +num); 61 | System.out.println("Count of Upper cases : " + up); 62 | System.out.println("Count of lower cases : " + low); 63 | System.out.println("Count of spaces : " + spc); 64 | System.out.println("Count of others : " + otr); 65 | } 66 | } -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J003May14.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | public class J003May14 { 6 | 7 | public static void main(String[] args) { 8 | 9 | //1st Program 10 | String inpt1 = "balaji.chandrasekaran@testleaf.com"; 11 | String inpt2 = "balaji.c@tunatap.co.uk"; 12 | String inpt3 = "naveen e@tl.com"; 13 | 14 | // String emailRegex = "^[a-zA-Z0-9_+&*-]+(?:\\."+ 15 | // "[a-zA-Z0-9_+&*-]+)*@" + 16 | // "(?:[a-zA-Z0-9-]+\\.)+[a-z" + 17 | // "A-Z]{2,7}$"; 18 | String emailRegex = "[a-zA-Z0-9._]+@[a-z0-9]+.[a-z.]+{2,}"; 19 | 20 | Pattern pat = Pattern.compile(emailRegex); 21 | 22 | System.out.println("Program 1"); 23 | if (pat.matcher(inpt1).matches()) System.out.println("Email address is valid : "+ inpt1); 24 | else System.out.println("Email address is not valid : "+ inpt1); 25 | 26 | if (pat.matcher(inpt2).matches()) System.out.println("Email address is valid : "+ inpt2); 27 | else System.out.println("Email address is not valid : "+ inpt2); 28 | 29 | if (pat.matcher(inpt3).matches()) System.out.println("Email address is valid : "+ inpt3); 30 | else System.out.println("Email address is not valid : "+ inpt3); 31 | System.out.println(); 32 | 33 | //2nd Program 34 | String in1 = "Balaji1"; 35 | String in2 = "Testleaf$123"; 36 | String in = in1; 37 | System.out.println("Program 2"); 38 | 39 | String reg = "[a-zA-Z0-9._$@]{8,}"; 40 | Pattern pat1 = Pattern.compile(reg); 41 | if (pat1.matcher(in).matches()) System.out.println("String is valid : "+ in); 42 | else System.out.println("String is not valid : "+ in); 43 | 44 | in = in2; 45 | if (pat1.matcher(in).matches()) System.out.println("String is valid : "+ in); 46 | else System.out.println("String is not valid : "+ in); 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J004May15.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | public class J004May15 { 4 | 5 | public static void main(String[] args) { 6 | 7 | //1st Program 8 | 9 | String s="Sachin"; 10 | s.concat(" Tendulkar");//concat() method appends the string at the end 11 | System.out.println(s);//will print Sachin because strings are immutable objects 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J005May18.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | import java.util.Set; 9 | 10 | public class J005May18 { 11 | 12 | public static void main(String[] args) { 13 | 14 | //1st Program 15 | System.out.println("Program 1"); 16 | String inpt = "When life gives you lemons, make lemonade"; 17 | Map baseMap = new HashMap(); 18 | char[] charArray = inpt.toCharArray(); 19 | for (Character ch : charArray) { 20 | if (baseMap.containsKey(ch)) { 21 | baseMap.put(ch, baseMap.get(ch) + 1); 22 | } else { 23 | baseMap.put(ch, 1); 24 | } 25 | } 26 | Set keys = baseMap.keySet(); 27 | for (Character ch : keys) { 28 | if (baseMap.get(ch) > 1) { 29 | System.out.println(ch + " is " + baseMap.get(ch) + " times"); 30 | } 31 | } 32 | System.out.println(); 33 | 34 | //2nd program 35 | // Write a java program to print the list 36 | // Input : [B,u,g,a,t,t,i, , C,h,i,r,o,n] 37 | System.out.println("Program 2"); 38 | List li = new ArrayList(Arrays.asList("B","u","g","a","t","t","i"," "," C","h","i","r","o","n")); 39 | System.out.println(li); 40 | 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J006May19.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | 6 | public class J006May19 { 7 | 8 | public static void main(String[] args) { 9 | 10 | // https://github.com/Bobpie/PractiseJavaPrograms 11 | 12 | //1. How to remove duplicates from a list? 13 | // List = c 14 | 15 | ArrayList list = new ArrayList<>(Arrays.asList("A","B","C","D","A","D","E","F")); 16 | System.out.println("ArrayList with duplicates: " + list); 17 | 18 | ArrayList newList = new ArrayList(); 19 | 20 | // Traverse through the first list 21 | for (String element : list) { 22 | 23 | // If this element is not present in newList 24 | // then add it 25 | if (!newList.contains(element)) { 26 | newList.add(element); 27 | } 28 | } 29 | System.out.println("ArrayList without duplicates: " +newList); 30 | System.out.println(); 31 | 32 | //2.How to retrieve a value from a Set? 33 | // Set = "1,2,3,4,5,6,7,8,9" retrieve and print only the value 7 34 | ArrayList list2 = new ArrayList<>(Arrays.asList(1,2,3,4,5,6,7,8,9)); 35 | System.out.println(list2); 36 | for (Integer element : list2) { 37 | if (element == 7) { 38 | System.out.println(element); 39 | } 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J007May20.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.HashMap; 4 | import java.util.Iterator; 5 | import java.util.LinkedHashMap; 6 | import java.util.Map; 7 | import java.util.Map.Entry; 8 | import java.util.Set; 9 | 10 | public class J007May20 { 11 | 12 | public static void main(String[] args) { 13 | // TODO Auto-generated method stub 14 | Map baseMap = new LinkedHashMap(); 15 | baseMap.put('A', 1); 16 | baseMap.put('B', 2); 17 | baseMap.put('C', 3); 18 | baseMap.put('D', 4); 19 | baseMap.put('E', 5); 20 | 21 | //Method 1 22 | System.out.println("Method 1"); 23 | System.out.println(baseMap); 24 | System.out.println(""); 25 | 26 | //Method 2 27 | System.out.println("Method 2"); 28 | for (Entry entry : baseMap.entrySet()) { 29 | System.out.println(entry.getKey()+" : "+entry.getValue()); 30 | } 31 | System.out.println(""); 32 | 33 | //Method 3 34 | System.out.println("Method 3"); 35 | baseMap.forEach((eachKey,eachValue)->System.out.println(eachKey + " -- "+eachValue)); 36 | System.out.println(""); 37 | 38 | //Method 4 39 | System.out.println("Method 4"); 40 | Iterator> It= baseMap.entrySet().iterator(); 41 | It.forEachRemaining((eachEntry)->System.out.println(eachEntry.getKey()+ " ~~ "+eachEntry.getValue())); 42 | System.out.println(""); 43 | 44 | //Method 5 45 | System.out.println("Method 5"); 46 | Iterator> It1= baseMap.entrySet().iterator(); 47 | while(It1.hasNext()) 48 | { 49 | Entry eachE = It1.next(); 50 | System.out.println(eachE.getKey()+ " -> "+eachE.getValue()); 51 | } 52 | System.out.println(""); 53 | 54 | // Iterator it = baseMap.entrySet().iterator(); 55 | // while (it.hasNext()) { 56 | // Map.Entry pair = (Map.Entry)it.next(); 57 | // System.out.println(pair.getKey() + " = " + pair.getValue()); 58 | // it.remove(); // avoids a ConcurrentModificationException 59 | // } 60 | // System.out.println(""); 61 | 62 | //Method 6 63 | System.out.println("Method 6"); 64 | baseMap.keySet().forEach((eachKey)->System.out.println(eachKey + " -- "+ baseMap.get(eachKey))); 65 | System.out.println(""); 66 | 67 | Set keys = baseMap.keySet(); 68 | for (Character ch : keys) { 69 | System.out.println(ch + " -> " + baseMap.get(ch)); 70 | } 71 | System.out.println(""); 72 | 73 | //To modify value in Map 74 | baseMap.entrySet().forEach((eachEntry)-> 75 | { 76 | if (eachEntry.getKey().equals('A')||eachEntry.getKey().equals('C')) 77 | { 78 | eachEntry.setValue(10); 79 | } 80 | else baseMap.put(eachEntry.getKey(),20); 81 | }); 82 | System.out.println(baseMap); 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J008May21.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.HashMap; 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | import java.util.Set; 7 | 8 | public class J008May21 { 9 | 10 | public static void main(String[] args) { 11 | 12 | String inpt = "Karma is powerful than God"; 13 | Map baseMap = new LinkedHashMap(); 14 | char[] charArray = inpt.toCharArray(); 15 | for (Character ch : charArray) { 16 | if (baseMap.containsKey(ch)) { 17 | baseMap.put(ch, baseMap.get(ch) + 1); 18 | } else { 19 | baseMap.put(ch, 1); 20 | } 21 | } 22 | System.out.println(baseMap); 23 | Set keys = baseMap.keySet(); 24 | for (Character ch : keys) { 25 | System.out.println(ch + " = " + baseMap.get(ch)); 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J009May26.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.Arrays; 4 | 5 | public class J009May26 { 6 | 7 | public static void main(String[] args) { 8 | //Program to sort array and reverse it 9 | System.out.println("Program 1"); 10 | int[] array = {5,1,33,79,22,11,45}; 11 | //O/p sorted {1,5,11,22,33,45,79} 12 | //reversed : {79,45,33,22,11,5,1} 13 | 14 | Arrays.sort(array); 15 | for (int i = 0; i < array.length;i++) 16 | { 17 | System.out.print(array[i] + " -- "); 18 | } 19 | System.out.println(""); 20 | for (int i = array.length-1 ; i >=0 ;i--) 21 | { 22 | System.out.print(array[i] + " -- "); 23 | } 24 | System.out.println(); 25 | //Progarm to find average of numbers in array 26 | int[] array2 = {20,30,25,35,-16,60,-100}; 27 | //O/p average is 7 28 | System.out.println("Program 2"); 29 | int sum = 0; 30 | for (int i = 0; i < array2.length;i++) 31 | { 32 | sum = sum + array2[i]; 33 | } 34 | System.out.println("Average is : "+ (sum/(array2.length))); 35 | System.out.println(); 36 | 37 | //Progarm to print common numbers in 2 array 38 | int[] array3 = {1,2,5,5,8,9,7,10}; 39 | int[] array4 = {1,0,6,15,6,4,7,0}; 40 | System.out.println("Program 3"); 41 | System.out.println("Program 3 - Common Elements in 2 Arrays"); 42 | for(int i = 0; i < array3.length; i++){ 43 | for(int j = 0; j < array4.length; j++){ 44 | if(array3[i] == array4[j]){ 45 | System.out.print(array3[i] + " "); 46 | break; 47 | } 48 | } 49 | } 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J010May27.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.Map.Entry; 6 | import java.util.Set; 7 | 8 | public class J010May27 { 9 | 10 | public static void main(String[] args) { 11 | 12 | int[] myarr = {1,2,5,5,6,6,7,2}; 13 | // System.out.println("Duplicate elements from array using hash table"); 14 | Map nameAndCount = new HashMap<>(); 15 | // build hash table with count 16 | for (int name : myarr) 17 | { 18 | Integer count = nameAndCount.get(name); 19 | if (count == null) nameAndCount.put(name, 1); 20 | else nameAndCount.put(name, ++count); 21 | } 22 | // Print duplicate elements from array in Java 23 | Set> entrySet = nameAndCount.entrySet(); 24 | for (Entry entry : entrySet) 25 | { 26 | if (entry.getValue() > 1) System.out.println("Duplicate element from array : " + entry.getKey()); 27 | } 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J011May28.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | public class J011May28 { 4 | 5 | public static void main(String[] args) { 6 | //Swapping number without using 3rd varialble 7 | System.out.println("Swapping Numbers"); 8 | int a = 5, b = 10; 9 | System.out.println("Before swap a is : "+ a + " ,b is : "+b ); 10 | 11 | a = a+b; 12 | b = a- b; 13 | a = a- b; 14 | 15 | System.out.println("After swap a is : "+ a + " ,b is : "+b ); 16 | 17 | //Fibonacci Series 18 | System.out.println("Fibonacci Series"); 19 | int n = 10; 20 | int n1 = 0, n2=1; 21 | String out = ""; 22 | 23 | for (int i = 1;i <= n;i++) 24 | { 25 | System.out.print(n1 + " + "); 26 | out = out + n1 + ","; 27 | int sum = n1 + n2; 28 | n1 = n2; 29 | n2 = sum; 30 | } 31 | System.out.println(""); 32 | String[] arr = out.split(","); 33 | 34 | for (int i = arr.length-1;i>=0;i--) 35 | System.out.print(arr[i] + " > "); 36 | System.out.println(""); 37 | 38 | //Armstrong Number 39 | // int a1 = 1000; 40 | // int temp =0; 41 | // System.out.println("Armstrong Numbers"); 42 | // for (int i =0; i <=a1;i++) 43 | // { 44 | // temp=i; 45 | // int originalNumber = 0,remainder=0,result=0,nn=0; 46 | // originalNumber = i; 47 | // 48 | // for (;originalNumber != 0; originalNumber /= 10, ++nn); 49 | // 50 | // originalNumber = i; 51 | // 52 | // for (;originalNumber != 0; originalNumber /= 10) 53 | // { 54 | // remainder = originalNumber % 10; 55 | // result += Math.pow(remainder, nn); 56 | // } 57 | // if(temp==result) 58 | // System.out.println(temp); 59 | // } 60 | int n3, b1, sum = 0,rng = 1000; 61 | System.out.println("Armstrong numbers from 1 to " + rng + ":"); 62 | 63 | for(int i = 1; i <= rng; i++) 64 | { 65 | n3 = i; 66 | while(n3 > 0) 67 | { 68 | b1 = n3 % 10; 69 | sum = sum + (b1 * b1 * b1); 70 | n3 = n3 / 10; 71 | } 72 | if(sum == i) 73 | { 74 | System.out.print(i+" "); 75 | } 76 | sum = 0; 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /Practice/src/main/java/javaprgms/J012May29.java: -------------------------------------------------------------------------------- 1 | package javaprgms; 2 | 3 | public class J012May29 { 4 | 5 | public static void main(String[] args) { 6 | 7 | // 1. Java program to transpose the matrix 8 | // Actual Matrix 9 | // 1 2 3 10 | // 4 5 6 11 | // 7 8 9 12 | // Tranposed Matrix 13 | // 1 4 7 14 | // 2 5 8 15 | // 3 6 9 16 | System.out.println("Transpose of Matrix"); 17 | int[][] a1 = new int[3][3]; 18 | int[][] a2 = new int[3][3]; 19 | a1[0][0] = 1; a1[0][1] = 2; a1[0][2] = 3; 20 | a1[1][0] = 4; a1[1][1] = 5; a1[1][2] = 6; 21 | a1[2][0] = 7; a1[2][1] = 8; a1[2][2] = 9; 22 | 23 | for (int i = 0; i <=2 ; i ++) 24 | { 25 | for (int j = 0 ; j <=2; j++) 26 | { 27 | a2[i][j] = a1[j][i]; 28 | } 29 | } 30 | 31 | for (int i = 0; i <=2 ; i ++) 32 | { 33 | for (int j = 0 ; j <=2; j++) 34 | { 35 | System.out.print(a2[i][j]+ " "); 36 | } 37 | System.out.println(); 38 | } 39 | System.out.println(); 40 | 41 | // 2.Write a java program to add 2 matrices 42 | // Matrices 1 43 | // 1 2 3 44 | // 4 5 6 45 | // 7 8 9 46 | // Matrices 2 47 | // 9 8 7 48 | // 6 5 4 49 | // 3 2 1 50 | // Solution 51 | // 10 10 10 52 | // 10 10 10 53 | // 10 10 10 54 | 55 | System.out.println("Sum of Matrix"); 56 | int[][] b1 = new int[3][3]; 57 | int[][] b2 = new int[3][3]; 58 | int[][] b3 = new int[3][3]; 59 | b1[0][0] = 1; b1[0][1] = 2; b1[0][2] = 3; 60 | b1[1][0] = 4; b1[1][1] = 5; b1[1][2] = 6; 61 | b1[2][0] = 7; b1[2][1] = 8; b1[2][2] = 9; 62 | 63 | b2[0][0] = 9; b2[0][1] = 8; b2[0][2] = 7; 64 | b2[1][0] = 6; b2[1][1] = 5; b2[1][2] = 4; 65 | b2[2][0] = 3; b2[2][1] = 2; b2[2][2] = 1; 66 | 67 | for (int i = 0; i <=2 ; i ++) 68 | { 69 | for (int j = 0 ; j <=2; j++) 70 | { 71 | b3[i][j] = b1[i][j] + b2[i][j]; 72 | System.out.print(b3[i][j]+ " "); 73 | } 74 | System.out.println(); 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC001Myntra.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.util.List; 4 | import java.util.concurrent.TimeUnit; 5 | import org.openqa.selenium.WebElement; 6 | import org.openqa.selenium.chrome.ChromeDriver; 7 | import org.openqa.selenium.chrome.ChromeOptions; 8 | import org.openqa.selenium.interactions.Actions; 9 | 10 | public class TC001Myntra { 11 | 12 | public static void main(String[] args) throws InterruptedException { 13 | // TODO Auto-generated method stub 14 | // 1) Open https://www.myntra.com/ 15 | String URL = "https://www.myntra.com/"; 16 | ChromeOptions options = new ChromeOptions(); 17 | options.addArguments("--disable-notifications"); 18 | System.setProperty ("webdriver.chrome.driver", "./drivers/chromedriver.exe"); 19 | ChromeDriver driver = new ChromeDriver(options); 20 | driver.get(URL); 21 | driver.manage().window().maximize(); 22 | driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 23 | 24 | // 2) Mouse over on WOMEN (Actions -> moveToElement 25 | WebElement ele = driver.findElementByXPath("(//a[text()='Women'])[1]"); 26 | Actions builder = new Actions(driver); 27 | builder.moveToElement(ele).perform(); 28 | 29 | // 3) Click Jackets & Coats 30 | driver.findElementByXPath("//a[text()='Jackets & Coats']").click(); 31 | Thread.sleep(5000); 32 | 33 | // 4) Find the total count of item (top) -> getText -> String 34 | // 35 | // String str = driver.findElementByClassName("title-count").getText(); 36 | // split, 37 | // String text = str.replaceAll("\\D","") -> String 38 | // Integer.parseInt(text) -> int 39 | String str = driver.findElementByXPath("//span[@class='title-count']").getText(); 40 | System.out.println(str); 41 | String txt = str.replaceAll("\\D", ""); 42 | int total = Integer.parseInt(txt); 43 | 44 | // 5) Validate the sum of categories count matches 45 | List category = driver.findElementsByXPath("//span[@class='categories-num']"); 46 | int sum = 0; 47 | for(int i = 0;i < category.size();i++) 48 | { 49 | String dt = category.get(i).getText(); 50 | 51 | sum = sum + Integer.parseInt(dt.replaceAll("\\D", "")); 52 | } 53 | 54 | if (sum == total) System.out.println("Matching : Sum is " + sum + " , Total is : " + total); 55 | else System.out.println("Not Matching : Sum is " + sum + " , Total is : " + total); 56 | // 6) Check Coats 57 | driver.findElementByXPath("//input[@value='Coats']//following-sibling::div").click(); 58 | 59 | // 7) Click + More option under BRAND 60 | driver.findElementByXPath("//div[@class='brand-more']").click(); 61 | Thread.sleep(3000); 62 | 63 | // 8) Type MANGO and click checkbox 64 | String brandName = "Mango"; 65 | driver.findElementByXPath("//input[@class='FilterDirectory-searchInput']").sendKeys(brandName); 66 | Thread.sleep(2000); 67 | driver.findElementByXPath("//label[@class=' common-customCheckbox']//following-sibling::div").click(); 68 | 69 | // 9) Close the pop-up x 70 | driver.findElementByXPath("//span[@class='myntraweb-sprite FilterDirectory-close sprites-remove']").click(); 71 | Thread.sleep(5000); 72 | 73 | // 10) Confirm all the Coats are of brand MANGO 74 | // findElements (brand) -> List 75 | // foreach -> getText of each brand 76 | // compare > if(condition) 77 | List brand = driver.findElementsByXPath("//h3[@class='product-brand']"); 78 | 79 | for(int i=0;i List 98 | // get(0) -> WebElement -> getText -> String -> int 99 | List price = driver.findElementsByXPath("//span[@class='product-discountedPrice']"); 100 | System.out.println("Price is : " + price.get(0).getText()); 101 | 102 | // 13) Mouse over on size of the first item 103 | WebElement ele2 = driver.findElementByXPath("(//h3[@class='product-brand'])[1]"); 104 | builder.moveToElement(ele2).perform(); 105 | Thread.sleep(1000); 106 | // WebElement ele3 = driver.findElementByXPath("(//span[@class='product-sizeNoInventoryPresent'])[4]"); 107 | // builder.moveToElement(ele3).perform(); 108 | 109 | // 14) Click on WishList Now 110 | driver.findElementByXPath("(//span[text()='wishlist now'])[1]").click(); 111 | Thread.sleep(7000); 112 | // 15) Close Browser 113 | driver.close(); 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC002Nykaa.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import org.openqa.selenium.WebElement; 9 | 10 | import base.api.ProjectSpecificMethods; 11 | 12 | public class TC002Nykaa extends ProjectSpecificMethods{ 13 | 14 | public static void main(String[] args) throws InterruptedException { 15 | // TODO Auto-generated method stub 16 | // 1) Go to https://www.nykaa.com/ 17 | String URL = "https://www.nykaa.com/"; 18 | // ChromeOptions options = new ChromeOptions(); 19 | // options.addArguments("--disable-notifications"); 20 | // System.setProperty ("webdriver.chrome.driver", "./drivers/chromedriver.exe"); 21 | // ChromeDriver driver = new ChromeDriver(options); 22 | // driver.get(URL); 23 | // driver.manage().window().maximize(); 24 | // driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 25 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 26 | psm.launch(URL); 27 | 28 | // 2) Mouseover on Brands and Mouseover on Popular 29 | // Actions builder = new Actions(driver); 30 | WebElement ele1 = driver.findElementByXPath("//a[text()='brands']"); 31 | builder.moveToElement(ele1).perform(); 32 | Thread.sleep(1000); 33 | 34 | // 3) Click L'Oreal Paris 35 | driver.findElementByXPath("(//a[contains(text(),'Oreal Paris')])[1]").click(); 36 | Thread.sleep(7000); 37 | 38 | // 4) Go to the newly opened window and check the title contains L'Oreal Paris 39 | String title = driver.getTitle(); 40 | if (title.contains("L'Oreal Paris")){ 41 | System.out.println("L'Oreal Paris is present"); 42 | } 43 | else 44 | { 45 | System.out.println("L'Oreal Paris is not present"); 46 | } 47 | // 5) Click sort By and select customer top rated 48 | driver.findElementByXPath("//div[@class='sort-btn clearfix']").click(); 49 | Thread.sleep(1000); 50 | driver.findElementByXPath("//span[text()='customer top rated']//following-sibling::div").click(); 51 | Thread.sleep(7000); 52 | 53 | // 6) Click Category and click Shampoo 54 | driver.findElementByXPath("//div[@class='filter-sidebar clearfix boundary-top']//div[text()='Category']").click(); 55 | Thread.sleep(5000); 56 | System.out.println("Before Checking 1st "+ driver.findElementByXPath("(//span[contains(text(),'Shampoo')]/ancestor::div[@class='control-box'])[1]/input").isSelected()); 57 | System.out.println("Before Checking 2nd "+ driver.findElementByXPath("(//span[contains(text(),'Shampoo')]/ancestor::div[@class='control-box'])[2]/input").isSelected()); 58 | driver.findElementByXPath("((//div[@class='filter-options-list active']//span[contains(text(),'Shampoo')])[1])//following-sibling::div").click(); 59 | Thread.sleep(5000); 60 | driver.findElementByXPath("((//div[@class='filter-options-list active']//span[contains(text(),'Shampoo')])[2])//following-sibling::div").click(); 61 | Thread.sleep(5000); 62 | 63 | // 7) check whether the Filter is applied with Shampoo 64 | boolean chkbx1 = driver.findElementByXPath("(//span[contains(text(),'Shampoo')]/ancestor::div[@class='control-box'])[1]/input").isSelected(); 65 | boolean chkbx2 = driver.findElementByXPath("(//span[contains(text(),'Shampoo')]/ancestor::div[@class='control-box'])[2]/input").isSelected(); 66 | System.out.println("After Checking 1st "+ chkbx1); 67 | System.out.println("After Checking 2nd "+ chkbx2); 68 | if (chkbx1 == true) System.out.println("Shampoo is selected"); 69 | else System.out.println("Shampoo is not selected"); 70 | if (chkbx2 == true) System.out.println("Shampoo is selected"); 71 | else System.out.println("Shampoo is not selected"); 72 | 73 | // 8) Click on L'Oreal Paris Colour Protect Shampoo 74 | driver.findElementByXPath("//span[text()=\"L'Oreal Paris Colour Protect Shampoo\"]").click(); 75 | Thread.sleep(5000); 76 | 77 | // 9) GO to the new window and select size as 175ml 78 | Set winSet = driver.getWindowHandles(); 79 | List winLis = new ArrayList(winSet); 80 | driver.switchTo().window(winLis.get(1)); 81 | 82 | driver.findElementByXPath("//span[text()='175ml']").click(); 83 | 84 | // 10) Print the MRP of the product 85 | String mrp = driver.findElementByXPath("(//span[@class='post-card__content-price-offer'])[1]").getText(); 86 | System.out.println("MRP is "+ mrp.replaceAll("\\D", "")); 87 | 88 | // 11) Click on ADD to BAG 89 | driver.findElementByXPath("(//button[text()='ADD TO BAG'])[1]").click(); 90 | Thread.sleep(2000); 91 | 92 | // 12) Go to Shopping Bag 93 | driver.findElementByXPath("//div[@class='AddBagIcon']").click(); 94 | Thread.sleep(3000); 95 | 96 | // 13) Print the Grand Total amount 97 | String grandTotal = driver.findElementByXPath("//div[@class='value medium-strong']").getText(); 98 | System.out.println("Grand Total is : "+grandTotal.replaceAll("\\D", "")); 99 | 100 | // 14) Click Proceed 101 | driver.findElementByXPath("//span[text()='Proceed']").click(); 102 | Thread.sleep(4000); 103 | 104 | // 15) Click on Continue as Guest 105 | driver.findElementByXPath("//button[text()='CONTINUE AS GUEST']").click(); 106 | Thread.sleep(2000); 107 | 108 | // 16) Print the warning message (delay in shipment) 109 | String wrngmsg = driver.findElementByXPath("//div[@class='message']").getText(); 110 | System.out.println(wrngmsg); 111 | 112 | // 17) Close all windows 113 | driver.close(); 114 | Thread.sleep(4000); 115 | driver.switchTo().window(winLis.get(0)); 116 | driver.close(); 117 | 118 | System.out.println(" *** Program Ends ***"); 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC003MakeMyTrip.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | import org.openqa.selenium.WebElement; 7 | import org.openqa.selenium.support.ui.Select; 8 | 9 | import base.api.ProjectSpecificMethods; 10 | 11 | public class TC003MakeMyTrip extends ProjectSpecificMethods{ 12 | 13 | public static void main(String[] args) throws InterruptedException { 14 | 15 | // 1) Go to https://www.makemytrip.com/ 16 | String URL = "https://www.makemytrip.com/"; 17 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 18 | psm.launch(URL); 19 | 20 | // 2) Click Hotels 21 | driver.findElementByXPath("//span[text()='Hotels']").click(); 22 | Thread.sleep(3000); 23 | 24 | // 3) Enter city as Goa, and choose Goa, India 25 | driver.findElementByXPath("//input[@id='city']").click(); 26 | driver.findElementByXPath("//input[@placeholder='Enter city/ Hotel/ Area/ Building']").sendKeys("goa"); 27 | Thread.sleep(3000); 28 | driver.findElementByXPath("//p[text()='Goa, India']").click(); 29 | Thread.sleep(3000); 30 | 31 | // 4) Enter Check in date as Next month 15th (May 15) and Check out as start date+5 32 | // driver.findElementByXPath("//p[@data-cy='checkInDate']").click(); 33 | driver.findElementByXPath("((//div[@class='DayPicker-Month'])[2])//div[text()='15']").click(); 34 | Thread.sleep(1000); 35 | driver.findElementByXPath("((//div[@class='DayPicker-Month'])[2])//div[text()='20']").click(); 36 | 37 | // 5) Click on ROOMS & GUESTS and click 2 Adults and one Children(age 12). Click Apply Button. 38 | driver.findElementByXPath("//label[@for='guest']").click(); 39 | 40 | driver.findElementByXPath("//ul[@data-cy='adultCount']//li[text()='2']").click(); 41 | driver.findElementByXPath("//li[@data-cy='children-1']").click(); 42 | Thread.sleep(100); 43 | WebElement ele1 = driver.findElementByXPath("//select[@class='ageSelectBox']"); 44 | Select drp = new Select(ele1); 45 | drp.selectByVisibleText("12"); 46 | driver.findElementByXPath("//button[@class='primaryBtn btnApply']").click(); 47 | 48 | // 6) Click Search button 49 | driver.findElementByXPath("//button[@id='hsw_search_button']").click(); 50 | Thread.sleep(5000); 51 | //p[text()='Explore Hotels on Map'] 52 | // driver.get(driver.getCurrentUrl()); 53 | // Thread.sleep(1000); 54 | // JavascriptExecutor js = (JavascriptExecutor) driver; 55 | // js.executeScript("window.scrollBy(0,500)"); 56 | 57 | // 7) Select locality as Baga 58 | // driver.findElementByXPath("(//label[text()='Baga']/parent::span)/input").click(); 59 | driver.switchTo().frame("webklipper-publisher-widget-container-notification-frame"); 60 | driver.findElementByXPath("//i[@class='we_forward']").click(); 61 | Thread.sleep(2000); 62 | driver.switchTo().defaultContent(); 63 | Thread.sleep(2000); 64 | driver.findElementByXPath("//a[@class='mapCont']").click(); 65 | Thread.sleep(2000); 66 | driver.findElementByXPath("//span[@class='mapClose']").click(); 67 | Thread.sleep(2000); 68 | // driver.findElementByXPath("//p[text()='Explore Hotels on Map']").click(); 69 | 70 | WebElement baga = driver.findElementByXPath("//label[text()='Baga']"); 71 | // builder.moveByOffset(baga.getLocation().getX(), baga.getLocation().getY()).perform(); 72 | builder.moveToElement(baga).perform(); 73 | baga.click(); 74 | Thread.sleep(3000); 75 | 76 | // 8) Select 5 start in Star Category under Select Filters 77 | // driver.findElementByXPath("(//label[text()='5 Star']/parent::span)/input").click(); 78 | // js.executeScript("window.scrollBy(0,1000)"); 79 | WebElement star = driver.findElementByXPath("//label[text()='5 Star']"); 80 | builder.moveToElement(star).perform(); 81 | star.click(); 82 | Thread.sleep(3000); 83 | 84 | // 9) Click on the first resulting hotel and go to the new window 85 | driver.findElementById("Listing_hotel_0").click(); 86 | Thread.sleep(3000); 87 | 88 | Set winSet = driver.getWindowHandles(); 89 | List winL= new ArrayList(winSet); 90 | driver.switchTo().window(winL.get(1)); 91 | 92 | // 10) Print the Hotel Name 93 | String hotelName = driver.findElementByXPath("//ul[@id='detpg_bread_crumbs']//li[3]/a").getText(); 94 | System.out.println("Hotel Name is : "+hotelName); 95 | 96 | // 11) Click MORE OPTIONS link and Select 3Months plan and close 97 | driver.findElementByXPath("//span[text()='MORE OPTIONS']").click(); 98 | Thread.sleep(3000); 99 | driver.findElementByXPath("//td[text()='3']//following-sibling::td[5]").click(); 100 | Thread.sleep(500); 101 | driver.findElementByXPath("//span[@class='close']").click(); 102 | 103 | // 12) Click on BOOK THIS NOW 104 | driver.findElementByXPath("//a[@id='detpg_headerright_book_now']").click(); 105 | Thread.sleep(1500); 106 | 107 | // 13) Print the Total Payable amount 108 | String totalpayable = driver.findElementByXPath("//span[@id='revpg_total_payable_amt']//text()[3]").getText(); 109 | System.out.println("Total Payable amount : " + totalpayable.replaceAll("\\D", "")); 110 | // 14) Close the browser 111 | 112 | driver.close(); 113 | driver.switchTo().window(winL.get(0)); 114 | driver.close(); 115 | 116 | System.out.println(" *** Program Ends ***"); 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC004Hp.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import org.openqa.selenium.WebElement; 4 | import org.openqa.selenium.support.ui.Select; 5 | 6 | import base.api.ProjectSpecificMethods; 7 | 8 | public class TC004Hp extends ProjectSpecificMethods{ 9 | 10 | public static void main(String[] args) throws InterruptedException { 11 | 12 | // 1) Go to https://store.hp.com/in-en/ 13 | String URL = "https://store.hp.com/in-en/"; 14 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 15 | psm.launch(URL); 16 | Thread.sleep(3000); 17 | driver.findElementByXPath("//button[text()='Accept Cookies']").click(); 18 | Thread.sleep(3000); 19 | 20 | boolean frm = driver.findElementByXPath("//iframe[@name='ifr_edmpopup']").isDisplayed(); 21 | 22 | if (frm == true) { 23 | // driver.switchTo().frame("ifr_edmpopup"); 24 | driver.findElementByXPath("//span[@class='optly-modal-close close-icon']").click(); 25 | // driver.switchTo().defaultContent(); 26 | } 27 | // 2) Mouse over on Laptops menu and click on Pavilion 28 | WebElement ele1 = driver.findElementByXPath("//a[@role='menuitem']/span[text()='Laptops']"); 29 | builder.moveToElement(ele1).perform(); 30 | driver.findElementByXPath("(//a[@role='menuitem']/span[text()='Pavilion'])[1]").click(); 31 | Thread.sleep(7000); 32 | 33 | // 3) Under SHOPPING OPTIONS -->Processor -->Select Intel Core i7 34 | 35 | 36 | driver.findElementByXPath("(//span[text()='Processor'])[2]").click(); 37 | driver.findElementByXPath("//span[text()='Intel Core i7']/parent::a/input").click(); 38 | Thread.sleep(5000); 39 | 40 | // 4) Hard Drive Capacity -->More than 1TB 41 | driver.findElementByXPath("//span[text()='More than 1 TB']/parent::a/input").click(); 42 | Thread.sleep(3000); 43 | 44 | // 5) Select Sort By: Price: Low to High 45 | WebElement sort = driver.findElementByXPath("(//select[@id='sorter'])[1]"); 46 | Select drp = new Select(sort); 47 | drp.selectByValue("price_asc"); 48 | Thread.sleep(3000); 49 | 50 | // 6) Print the First resulting Product Name and Price 51 | String prdName = driver.findElementByXPath("(//li[@class='item product product-item'])[1]//a[@class='product-item-link']").getText(); 52 | String price = driver.findElementByXPath("(//li[@class='item product product-item'])[1]//span[@data-price-type='finalPrice']").getText(); 53 | price = price.replaceAll("\\D", ""); 54 | System.out.println("Product Name : "+prdName + " Price : "+price); 55 | 56 | // 7) Click on Add to Cart 57 | driver.findElementByXPath("(//li[@class='item product product-item'])[1]//span[text()='Add To Cart']").click(); 58 | Thread.sleep(3000); 59 | driver.findElementByXPath("//div[@class='inside_closeButton fonticon icon-hclose']").click(); 60 | Thread.sleep(1000); 61 | // 8) Click on Shopping Cart icon --> Click on View and Edit Cart 62 | driver.findElementByXPath("//a[@title='Shopping Cart']").click(); 63 | driver.findElementByXPath("//span[text()='View and edit cart']").click(); 64 | Thread.sleep(3000); 65 | 66 | // 9) Check the Shipping Option --> Check availability at Pincode 67 | driver.findElementByXPath("//input[@name='pincode']").sendKeys("600126"); 68 | driver.findElementByXPath("//button[@class='primary standard_delivery-button']").click(); 69 | Thread.sleep(3000); 70 | 71 | // 10) Verify the order Total against the product price 72 | String total = driver.findElementByXPath("//strong[text()='Order Total']//ancestor::tr//span").getText(); 73 | total = total.replaceAll("\\D", ""); 74 | System.out.println("Total price is : "+total); 75 | boolean matchFound = false; 76 | if (Integer.parseInt(price)==Integer.parseInt(total)) matchFound = true; 77 | else System.out.println("Prices are not matching"); 78 | 79 | // 11) Proceed to Checkout if Order Total and Product Price matches 80 | if (matchFound == true) driver.findElementByXPath("(//button[@title='Proceed to Checkout'])[1]").click(); 81 | Thread.sleep(7000); 82 | 83 | // 12) Click on Place Order 84 | driver.findElementByXPath("//div[@class='place-order-primary']/button").click(); 85 | Thread.sleep(3000); 86 | 87 | // 13) Capture the Error message and Print 88 | String errmsg = driver.findElementByXPath("//div[@class='message notice']/span").getText(); 89 | System.out.println("Error Message is : "+errmsg); 90 | 91 | // 14) Close Browser 92 | driver.close(); 93 | 94 | System.out.println(" *** Program Ends ***"); 95 | 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC005Postman.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | import org.openqa.selenium.chrome.ChromeDriver; 7 | import org.openqa.selenium.chrome.ChromeOptions; 8 | 9 | public class TC005Postman { 10 | 11 | public static void main(String[] args) throws IOException, InterruptedException { 12 | // TODO Auto-generated method stub 13 | // Precondition: Postman chrome download 14 | // 15 | // 1) Open Postman desktop application using Selenium 16 | Runtime runTime = Runtime.getRuntime(); 17 | runTime.exec("C:\\Users\\BM\\Downloads\\Postman.exe"); 18 | 19 | // 2) Create New Collection as RestLearning 20 | ChromeOptions options = new ChromeOptions(); 21 | options.addArguments("--disable-notifications"); 22 | System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver66.exe"); 23 | System.setProperty("webdriver.chrome.silentOutput", "true"); 24 | ChromeDriver driver = new ChromeDriver(options); 25 | // driver.manage().window().maximize(); 26 | driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 27 | Thread.sleep(5000); 28 | driver.findElementByXPath("//div[@class='btn btn-primary']").click(); 29 | driver.findElementByXPath("//span[text()'Collection']").click(); 30 | driver.findElementByXPath("//input[@class='input input-box collection-modal-name-input']").sendKeys("New1"); 31 | driver.findElementByXPath("//div[text()='Create']").click(); 32 | // 3) Check whether the collection already exist 33 | // 4) If exist, delete the existing Collection 34 | // 5) Create new Collection 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC006BigBasket.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import org.openqa.selenium.Keys; 4 | import org.openqa.selenium.WebElement; 5 | 6 | import base.api.ProjectSpecificMethods; 7 | 8 | public class TC006BigBasket extends ProjectSpecificMethods{ 9 | 10 | public static void main(String[] args) throws InterruptedException { 11 | 12 | // 1) Go to https://www.bigbasket.com/ 13 | String URL = "https://www.bigbasket.com/"; 14 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 15 | psm.launch(URL); 16 | 17 | // 2) mouse over on Shop by Category 18 | WebElement ele1 = driver.findElementByXPath("(//a[text()=' Shop by Category '])[1]"); 19 | builder.moveToElement(ele1).perform(); 20 | Thread.sleep(1000); 21 | 22 | // 3)Go to FOODGRAINS, OIL & MASALA --> RICE & RICE PRODUCTS 23 | WebElement ele2 = driver.findElementByXPath("(//a[text()='Foodgrains, Oil & Masala'])[2]"); 24 | builder.moveToElement(ele2).perform(); 25 | Thread.sleep(1000); 26 | WebElement ele3 = driver.findElementByXPath("(//a[text()='Rice & Rice Products'])[2]"); 27 | builder.moveToElement(ele3).perform(); 28 | Thread.sleep(1000); 29 | 30 | // 4) Click on Boiled & Steam Rice 31 | driver.findElementByXPath("(//a[text()='Boiled & Steam Rice'])[2]").click(); 32 | Thread.sleep(1000); 33 | 34 | // 5) Choose the Brand as bb Royal 35 | driver.findElementByXPath("(//span[text()='bb Royal'])[1]").click(); 36 | Thread.sleep(3000); 37 | 38 | // 6) Go to Ponni Boiled Rice - Super Premium and select 5kg bag from Dropdown 39 | WebElement ele4 = driver.findElementByXPath("(((//a[text()='Ponni Boiled Rice - Super Premium']//parent::div)//following-sibling::div)[1])//button/i"); 40 | builder.click(ele4).perform(); 41 | Thread.sleep(1000); 42 | 43 | WebElement ele5 = driver.findElementByXPath("(((((//a[text()='Ponni Boiled Rice - Super Premium']//parent::div)//following-sibling::div)[1])//button)//following-sibling::ul)//span[contains(text(),'5 kg')]"); 44 | builder.click(ele5).perform(); 45 | Thread.sleep(1000); 46 | 47 | // 7) print the price of Rice 48 | int ricePrice = Integer.parseInt(driver.findElementByXPath("(((//a[text()='Ponni Boiled Rice - Super Premium']//parent::div)//following-sibling::div)[2])//span[@class='discnt-price']/span").getText()); 49 | System.out.println("Price of Rice : "+ricePrice); 50 | 51 | // 8) Click Add button 52 | driver.findElementByXPath("(((//a[text()='Ponni Boiled Rice - Super Premium']//parent::div)//following-sibling::div)[2])//button[text()='Add ']").click(); 53 | // Thread.sleep(1000); 54 | 55 | // 9) Verify the success message displayed 56 | System.out.println(driver.findElementByXPath("//div[@class='toast toast-success']//div").getText()); 57 | 58 | // 10) Type Dal in Search field and enter 59 | driver.findElementByXPath("(//div[@class='input-group'])[1]/input").sendKeys("Dal",Keys.ENTER); 60 | Thread.sleep(5000); 61 | 62 | // 12) Go to Toor/Arhar Dal and select 2kg & set Qty 2 63 | WebElement ele6 = driver.findElementByXPath("((//a[text()='Toor/Arhar Dal/Thuvaram Paruppu']//parent::div)//following-sibling::div)[2]//input[@ng-model='vm.startQuantity']"); 64 | ele6.clear(); 65 | ele6.sendKeys("2"); 66 | Thread.sleep(1000); 67 | 68 | // 13) Print the price of Dal 69 | int dalPrice = Integer.parseInt(driver.findElementByXPath("(((//a[text()='Toor/Arhar Dal/Thuvaram Paruppu']//parent::div)//following-sibling::div)[2])//span[@class='discnt-price']/span").getText()); 70 | System.out.println("Dal price is : "+dalPrice); 71 | 72 | // 14) Click Add button 73 | driver.findElementByXPath("(((//a[text()='Toor/Arhar Dal/Thuvaram Paruppu']//parent::div)//following-sibling::div)[2])//button[text()='Add ']").click(); 74 | // Thread.sleep(500); 75 | System.out.println(driver.findElementByXPath("//div[@class='toast toast-success']//div").getText()); 76 | 77 | // 15) Mouse hover on My Basket 78 | WebElement ele7 = driver.findElementByXPath("//a[@qa='myBasket']"); 79 | builder.moveToElement(ele7).perform(); 80 | 81 | // 16) Validate the Sub Total displayed for the selected items 82 | int total = Integer.parseInt(driver.findElementByXPath("//span[@ng-bind='vm.cart.cart_total']").getText()); 83 | 84 | int total1 = ricePrice + (2 * dalPrice); 85 | 86 | if (total == total1) System.out.println("Total is matching : "+ total + " , " +total1); 87 | else System.out.println("Total is not matching : "+ total + " , " +total1); 88 | 89 | // 17) Reduce the Quantity of Dal as 1 90 | driver.findElementByXPath("(//a[contains(text(),'Toor/Arhar Dal')]//ancestor::div[contains(@class,'item-info')]/following-sibling::div)//button[1]").click(); 91 | Thread.sleep(2000); 92 | 93 | // 18) Validate the Sub Total for the current items 94 | total = Integer.parseInt(driver.findElementByXPath("//span[@ng-bind='vm.cart.cart_total']").getText()); 95 | total1 = ricePrice + dalPrice; 96 | if (total == total1) System.out.println("Total is matching : "+ total + " , " +total1); 97 | else System.out.println("Total is not matching : "+ total + " , " +total1); 98 | 99 | // 19) Close the Browser 100 | driver.close(); 101 | 102 | System.out.println(" *** Program Ends ***"); 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC007Honda.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | import org.openqa.selenium.By; 8 | import org.openqa.selenium.WebElement; 9 | import org.openqa.selenium.support.ui.Select; 10 | 11 | import base.api.ProjectSpecificMethods; 12 | 13 | public class TC007Honda extends ProjectSpecificMethods { 14 | 15 | public static void main(String[] args) throws InterruptedException { 16 | 17 | // 1) Go to https://www.honda2wheelersindia.com/ 18 | String URL = "https://www.honda2wheelersindia.com/"; 19 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 20 | psm.launch(URL); 21 | Thread.sleep(5000); 22 | WebElement elep = driver.findElementByXPath("//div[@class='modal-body']//button"); 23 | if (elep.isDisplayed() == true) elep.click(); 24 | Thread.sleep(500); 25 | 26 | // 2) Click on scooters and click dio 27 | driver.findElementByXPath("//a[@id='link_Scooter']").click(); 28 | Thread.sleep(500); 29 | 30 | driver.findElementByXPath("//img[contains(@src,'dioBS6-icon')]").click(); 31 | Thread.sleep(500); 32 | 33 | // 3) Click on Specifications and mouseover on ENGINE 34 | driver.findElementByXPath("//a[text()='Specifications']").click(); 35 | Thread.sleep(500); 36 | WebElement ele1 = driver.findElementByXPath("//a[text()='ENGINE']"); 37 | builder.moveToElement(ele1).perform(); 38 | Thread.sleep(500); 39 | 40 | // 4) Get Displacement value 41 | String displdio = driver.findElementByXPath("//span[text()='Displacement']//following-sibling::span").getText(); 42 | String scname = "Dio"; 43 | System.out.println(displdio); 44 | 45 | // 5) Go to Scooters and click Activa 125 46 | driver.findElementByXPath("//a[@id='link_Scooter']").click(); 47 | Thread.sleep(500); 48 | driver.findElementByXPath("//img[contains(@src,'activa-125new-icon')]").click(); 49 | Thread.sleep(500); 50 | 51 | // 6) Click on Specifications and mouseover on ENGINE 52 | driver.findElementByXPath("//a[text()='Specifications']").click(); 53 | Thread.sleep(500); 54 | WebElement ele2 = driver.findElementByXPath("//a[text()='ENGINE']"); 55 | builder.moveToElement(ele2).perform(); 56 | Thread.sleep(500); 57 | 58 | // 7) Get Displacement value 59 | String dispactiva125 = driver.findElementByXPath("//span[text()='Displacement']//following-sibling::span").getText(); 60 | String scname1 = "Activa 125 New"; 61 | System.out.println(dispactiva125); 62 | 63 | // 8) Compare Displacement of Dio and Activa 125 and print the Scooter name having better Displacement. 64 | displdio = (displdio.replaceAll(" ", "")).replaceAll("cc", ""); 65 | dispactiva125 = (dispactiva125.replaceAll(" ", "")).replaceAll("cc", ""); 66 | 67 | float val1 = Float.parseFloat(displdio); 68 | float val2 = Float.parseFloat(dispactiva125); 69 | 70 | System.out.println(scname + " displacement is : "+val1 ); 71 | System.out.println(scname1 + " displacement is : "+val2 ); 72 | 73 | if (val1 > val2) System.out.println("Scooter Name is : "+scname); 74 | else System.out.println("Scooter Name is : "+scname1); 75 | 76 | // 9) Click FAQ from Menu 77 | driver.findElementByXPath("(//a[text()='FAQ'])[1]").click(); 78 | Thread.sleep(1500); 79 | 80 | // 10) Click Activa 125 BS-VI under Browse By Product 81 | driver.findElementByXPath("(//a[text()='Activa 125 BS-VI'])").click(); 82 | Thread.sleep(1500); 83 | 84 | // 11) Click Vehicle Price 85 | driver.findElementByXPath("(//a[text()=' Vehicle Price'])").click(); 86 | Thread.sleep(1500); 87 | 88 | // 12) Make sure Activa 125 BS-VI selected and click submit 89 | WebElement ele3 = driver.findElementByXPath("//select[@id='ModelID6']"); 90 | Select options = new Select(ele3); 91 | String opt = options.getFirstSelectedOption().getText(); 92 | System.out.println("Selected option is : "+ opt); 93 | if (opt.contentEquals("Activa 125 BS-VI")) System.out.println("Activa 125 BS-VI is selected"); 94 | else System.out.println("Activa 125 BS-VI is not selected"); 95 | 96 | driver.findElementByXPath("(//button[text()='Submit'])[6]").click(); 97 | Thread.sleep(1500); 98 | 99 | // 13) click the price link 100 | driver.findElementByXPath("//a[text()='Click here to know the price of Activa 125 BS-VI.']").click(); 101 | Thread.sleep(1500); 102 | 103 | // 14) Go to the new Window and select the state as Tamil Nadu and city as Chennai 104 | Set winH = driver.getWindowHandles(); 105 | List winL = new ArrayList(winH); 106 | driver.switchTo().window(winL.get(1)); 107 | 108 | WebElement ele4 = driver.findElementByXPath("//select[@name='StateID']"); 109 | Select opt1 = new Select(ele4); 110 | opt1.selectByVisibleText("Tamil Nadu"); 111 | Thread.sleep(500); 112 | 113 | WebElement ele5 = driver.findElementByXPath("//select[@name='CityID']"); 114 | Select opt2 = new Select(ele5); 115 | opt2.selectByVisibleText("Chennai"); 116 | Thread.sleep(500); 117 | 118 | // 15) Click Search 119 | driver.findElementByXPath("//button[text()='Search']").click(); 120 | Thread.sleep(1500); 121 | 122 | // 16) Print all the 3 models and their prices 123 | List trow = driver.findElementsByXPath("//table[@id='gvshow']//tbody/tr"); 124 | 125 | for (int i = 0; i < trow.size();i++) 126 | { 127 | WebElement trr = trow.get(i); 128 | List tcol = trr.findElements(By.tagName("td")); 129 | 130 | for (int j = 0; j < tcol.size();j++) 131 | { 132 | if (tcol.get(j).getText().equalsIgnoreCase("Chennai") == false) 133 | System.out.print(tcol.get(j).getText() + " --- " ); 134 | } 135 | System.out.println(""); 136 | } 137 | 138 | // 17) Close the Browser 139 | driver.close(); 140 | Thread.sleep(3000); 141 | driver.switchTo().window(winL.get(0)); 142 | driver.close(); 143 | System.out.println(" *** Program Ends ***"); 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC008Pepperfry.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.apache.commons.io.FileUtils; 7 | import org.openqa.selenium.Keys; 8 | import org.openqa.selenium.OutputType; 9 | import org.openqa.selenium.WebElement; 10 | 11 | import base.api.ProjectSpecificMethods; 12 | 13 | public class TC008Pepperfry extends ProjectSpecificMethods{ 14 | 15 | public static void main(String[] args) throws InterruptedException, IOException { 16 | 17 | // 1) Go to https://www.pepperfry.com/ 18 | String URL = "https://www.pepperfry.com/"; 19 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 20 | psm.launch(URL); 21 | Thread.sleep(4000); 22 | WebElement popup = driver.findElementByXPath("//div[@id='regPopUp']//a[@class='popup-close']"); 23 | if (popup.isDisplayed() == true) popup.click(); 24 | 25 | // 2) Mouseover on Furniture and click Office Chairs under Chairs 26 | WebElement ele1 = driver.findElementByXPath("(//a[text()='Furniture'])[1]"); 27 | builder.moveToElement(ele1).perform(); 28 | Thread.sleep(500); 29 | driver.findElementByXPath("(//a[text()='Office Chairs'])").click(); 30 | Thread.sleep(1000); 31 | 32 | // 3) click Executive Chairs 33 | driver.findElementByXPath("(//h5[text()='Executive Chairs'])").click(); 34 | Thread.sleep(1000); 35 | 36 | // 4) Change the minimum Height as 50 in under Dimensions 37 | driver.findElementByXPath("(//input[@class='clipFilterDimensionHeightValue'])[1]").clear(); 38 | driver.findElementByXPath("(//input[@class='clipFilterDimensionHeightValue'])[1]").sendKeys("50",Keys.ENTER); 39 | Thread.sleep(1000); 40 | 41 | // 5) Add "Poise Executive Chair in Black Colour" chair to Wishlist 42 | driver.findElementByXPath("//a[text()='Poise Executive Chair in Black Colour']//ancestor::div[@class='clip-dtl-ttl row']/following-sibling::div[@class='row clip-dtl-brand']//a[@id='clip_wishlist_']").click(); 43 | Thread.sleep(1000); 44 | 45 | // 6) Mouseover on Homeware and Click Pressure Cookers under Cookware 46 | WebElement ele2 = driver.findElementByXPath("(//a[text()='Homeware'])[1]"); 47 | builder.moveToElement(ele2).perform(); 48 | Thread.sleep(500); 49 | driver.findElementByXPath("(//a[text()='Pressure Cookers'])").click(); 50 | Thread.sleep(1000); 51 | 52 | // 7) Select Prestige as Brand 53 | driver.findElementByXPath("//li[@data-search='Prestige']//label[text()='Prestige']").click(); 54 | Thread.sleep(2000); 55 | 56 | // 8) Select Capacity as 1-3 Ltr 57 | driver.findElementByXPath("(//label[text()='1 Ltr - 3 Ltr'])[1]").click(); 58 | Thread.sleep(3000); 59 | 60 | // 9) Add "Nakshatra Cute Metallic Red Aluminium Cooker 2 Ltr" to Wishlist 61 | WebElement ckr = driver.findElementByXPath("(//a[text()='Nakshatra Cute Metallic Red Aluminium Cooker 2 Ltr']//ancestor::div[@class='clip-dtl-ttl row']/following-sibling::div[@class='row clip-dtl-brand']//a[@id='clip_wishlist_'])"); 62 | builder.moveToElement(ckr).perform(); 63 | ckr.click(); 64 | Thread.sleep(1000); 65 | 66 | // 10) Verify the number of items in Wishlist 67 | String cnt = driver.findElementByXPath("//div[@class='wishlist_bar']//span").getText(); 68 | int cntt = Integer.parseInt(cnt); 69 | System.out.println( "Count is : "+cnt); 70 | if (cntt== 2) System.out.println("Items match in wishlist : "+ cnt); 71 | else System.out.println("Items not match in wishlist : "+ cnt); 72 | 73 | // 11) Navigate to Wishlist 74 | driver.findElementByXPath("//div[@class='wishlist_bar']//a").click(); 75 | Thread.sleep(1000); 76 | 77 | // 12) Move Pressure Cooker only to Cart from Wishlist 78 | WebElement cart = driver.findElementByXPath("//a[contains(text(),'Nakshatra Cute Metallic Red Aluminium Cooker 2 Ltr')]//ancestor::div[@class='item_details']//a[text()='Add to Cart']"); 79 | builder.moveToElement(cart).perform(); 80 | builder.click(cart).perform(); 81 | Thread.sleep(1000); 82 | 83 | // 13) Check for the availability for Pincode 600128 84 | driver.findElementByXPath("//span[text()='Showing availability at']/following-sibling::input").sendKeys("600126"); 85 | Thread.sleep(1000); 86 | driver.findElementByXPath("//a[text()='Check']").click(); 87 | Thread.sleep(1000); 88 | 89 | // 14) Click Proceed to Pay Securely 90 | driver.findElementByXPath("//a[text()='Proceed to pay securely ']").click(); 91 | Thread.sleep(3000); 92 | 93 | // 15 Click Proceed to Pay 94 | 95 | // 16) Capture the screenshot of the item under Order Item 96 | WebElement ele4 = driver.findElementByXPath("//a[@class='ck-pro-img-link']/img"); 97 | File src = ele4.getScreenshotAs(OutputType.FILE); 98 | File dst = new File("./snaps/Cooker.jpg"); 99 | FileUtils.copyFile(src, dst); 100 | 101 | // 17) Close the browser 102 | driver.close(); 103 | 104 | System.out.println(" *** Program Ends ***"); 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC009CrmCloud.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Calendar; 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | import org.openqa.selenium.By; 9 | import org.openqa.selenium.Keys; 10 | import org.openqa.selenium.WebElement; 11 | 12 | import base.api.ProjectSpecificMethods; 13 | 14 | public class TC009CrmCloud extends ProjectSpecificMethods { 15 | 16 | public static void main(String[] args) throws InterruptedException, Exception{ 17 | 18 | // 1) Go to https://demo.1crmcloud.com/ 19 | String URL = "https://demo.1crmcloud.com/"; 20 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 21 | psm.launch(URL); 22 | 23 | // 2) Give username as admin and password as admin 24 | driver.findElementByXPath("//input[@id='login_user']").sendKeys("admin"); 25 | driver.findElementByXPath("//input[@id='login_pass']").sendKeys("admin"); 26 | 27 | driver.findElementByXPath("//button[@id='login_button']").click(); 28 | Thread.sleep(3000); 29 | 30 | // 3) Choose theme as Claro Theme 31 | driver.findElementByXPath("//div[@id='user_theme-input']//span[@class='input-label single']").click(); 32 | Thread.sleep(200); 33 | driver.findElementByXPath("//div[text()='Claro Theme']").click(); 34 | Thread.sleep(2000); 35 | 36 | // 4) Click on Sales and Marketting 37 | driver.findElementByXPath("//div[text()='Sales & Marketing']").click(); 38 | Thread.sleep(2000); 39 | 40 | // 5) Click Create contact 41 | driver.findElementByXPath("//div[text()='Create Contact']").click(); 42 | Thread.sleep(5000); 43 | 44 | // 6) Select Title and type First name, Last Name, Email and Phone Numbers 45 | driver.findElementByXPath("//div[@id='DetailFormsalutation-input']").click(); 46 | Thread.sleep(200); 47 | driver.findElementByXPath("//div[text()='Mr.']").click(); 48 | 49 | driver.findElementByXPath("//input[@id='DetailFormfirst_name-input']").sendKeys("Mathanvel"); 50 | driver.findElementByXPath("//input[@id='DetailFormlast_name-input']").sendKeys("Rathinavelu"); 51 | driver.findElementByXPath("//input[@id='DetailFormemail1-input']").sendKeys("rmvvel@gmail.com"); 52 | driver.findElementByXPath("//input[@id='DetailFormphone_work-input']").sendKeys("9994923354"); 53 | 54 | // 7) Select Lead Source as "Public Relations" 55 | driver.findElementByXPath("//div[@id='DetailFormlead_source-input']").click(); 56 | Thread.sleep(200); 57 | driver.findElementByXPath("//div[text()='Public Relations']").click(); 58 | 59 | // 8) Select Business Roles as "Sales" 60 | driver.findElementByXPath("//div[@id='DetailFormbusiness_role-input']").click(); 61 | Thread.sleep(200); 62 | driver.findElementByXPath("//div[text()='Sales']").click(); 63 | 64 | // 9) Fill the Primary Address, City, State, Country and Postal Code and click Save 65 | driver.findElementByXPath("//textarea[@id='DetailFormprimary_address_street-input']").sendKeys("F1, WRM"); 66 | driver.findElementByXPath("//input[@id='DetailFormprimary_address_city-input']").sendKeys("Chennai"); 67 | driver.findElementByXPath("//input[@id='DetailFormprimary_address_state-input']").sendKeys("Tamil Nadu"); 68 | driver.findElementByXPath("//input[@id='DetailFormprimary_address_country-input']").sendKeys("India"); 69 | driver.findElementByXPath("//input[@id='DetailFormprimary_address_postalcode-input']").sendKeys("600126"); 70 | 71 | driver.findElementByXPath("//span[@id='DetailForm_save2-label']").click(); 72 | Thread.sleep(4000); 73 | 74 | // 10) Mouse over on Today's Activities and click Meetings 75 | WebElement ele1 = driver.findElementByXPath("//li[@id='grouptab-0']"); 76 | builder.moveToElement(ele1).perform(); 77 | driver.findElementByXPath("//div[text()='Meetings']").click(); 78 | Thread.sleep(4000); 79 | 80 | // 11) Click Create 81 | driver.findElementByXPath("(//span[text()='Create'])[1]").click(); 82 | Thread.sleep(3000); 83 | 84 | // 12) Type Subject as "Project Status" , Status as "Planned" 85 | driver.findElementByXPath("//input[@id='DetailFormname-input']").sendKeys("Project Status"); 86 | String sts = driver.findElementByXPath("//div[@id='DetailFormstatus-input-label']").getText(); 87 | if (sts.equalsIgnoreCase("Planned")) System.out.println("Status is : "+sts); 88 | else 89 | { 90 | System.out.println("Status is : "+sts); 91 | driver.findElementByXPath("//div[@id='DetailFormstatus-input-label']").click(); 92 | Thread.sleep(200); 93 | driver.findElementByXPath("(//div[text()='Planned'])[1]").click(); 94 | Thread.sleep(1000); 95 | } 96 | 97 | // 13) Start Date & Time as tomorrow 3 pm and Duration as 1hr 98 | 99 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 100 | Date date = new Date(); 101 | System.out.println(formatter.format(date)); 102 | String oldDate = formatter.format(date); 103 | Calendar c = Calendar.getInstance(); 104 | //Setting the date to the given date 105 | try { 106 | c.setTime(formatter.parse(oldDate)); 107 | } catch (Exception e) { 108 | // TODO Auto-generated catch block 109 | e.printStackTrace(); 110 | } 111 | //Number of Days to add 112 | int days = 4; 113 | c.add(Calendar.DAY_OF_MONTH, days); 114 | //Date after adding the days to the given date 115 | String newDate = formatter.format(c.getTime()); 116 | //Displaying the new Date after addition of Days 117 | System.out.println("Date after Addition: "+newDate); 118 | 119 | driver.findElementByXPath("//div[@class='input-label datetime-label text-number']").click(); 120 | Thread.sleep(200); 121 | driver.findElementByXPath("//div[@id='DetailFormdate_start-calendar-text']//input").sendKeys(newDate,Keys.ENTER); 122 | Thread.sleep(200); 123 | driver.findElementByXPath("//div[@id='DetailFormdate_start-calendar-text']//input").sendKeys("15:00",Keys.ENTER); 124 | Thread.sleep(200); 125 | 126 | // 14) Click Add paricipants, add your created Contact name and click Save 127 | driver.findElementByXPath("//span[text()=' Add Participants']").click(); 128 | Thread.sleep(200); 129 | String srchtxt = "Mathanvel"; 130 | driver.findElementByXPath("//div[@id='app-search-text']//input").sendKeys(srchtxt); 131 | Thread.sleep(200); 132 | driver.findElementByXPath("(//span[text()='Search Results (Invitees)']/ancestor::div[@class='card-header panel-subheader'])/following-sibling::div//div[contains(text(),'" + srchtxt + "')]").click(); 133 | Thread.sleep(4000); 134 | driver.findElementByXPath("(//span[text()='Save'])[2]").click(); 135 | Thread.sleep(4000); 136 | 137 | // 15) Go to Sales and Marketting-->Contacts 138 | WebElement ele2 = driver.findElementByXPath("//div[text()='Sales & Marketing']"); 139 | builder.moveToElement(ele2).perform(); 140 | Thread.sleep(1000); 141 | driver.findElementByXPath("//div[text()='Contacts']").click(); 142 | Thread.sleep(1000); 143 | 144 | // 16) search the lead Name and click the name from the result 145 | driver.findElementByXPath("//input[@id='filter_text']").sendKeys(srchtxt); 146 | Thread.sleep(1000); 147 | driver.findElementByXPath("//input[@id='filter_text']").sendKeys(Keys.ENTER); 148 | Thread.sleep(1400); 149 | driver.findElementByXPath("//td[@class='listViewTd']//a[contains(text(),'"+ srchtxt + "')]").click(); 150 | Thread.sleep(4000); 151 | 152 | // 17) Check weather the Meeting is assigned to the contact under Activities Section. 153 | List tr = driver.findElementsByXPath("//span[@id='subpanel-activities']//ancestor::div[@class='card-outer panel-outer listview-panel panel-system panel-border']//table//tbody//tr"); 154 | 155 | for (int i = 0;i td = tr.get(i).findElements(By.tagName("td")); 158 | System.out.println(td.get(4).getText()); 159 | if (td.get(4).getText().contains("Planned")) System.out.println("Matching"); 160 | else System.out.println("Not Matching"); 161 | } 162 | 163 | driver.close(); 164 | 165 | System.out.println(" *** Program Ends ***"); 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC010JustDial.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | import java.util.Map.Entry; 8 | 9 | import org.openqa.selenium.By; 10 | import org.openqa.selenium.WebElement; 11 | import org.openqa.selenium.support.ui.ExpectedConditions; 12 | import org.openqa.selenium.support.ui.WebDriverWait; 13 | 14 | import base.api.ProjectSpecificMethods; 15 | 16 | public class TC010JustDial extends ProjectSpecificMethods { 17 | 18 | public static void main(String[] args) throws InterruptedException, IOException{ 19 | 20 | // 1) https://www.justdial.com/ 21 | String URL = "https://www.justdial.com/"; 22 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 23 | psm.killprocess(true, false, true); 24 | psm.launch(URL); 25 | // implicit wait and delete chromedriver at start of execution 26 | Thread.sleep(5000); 27 | 28 | // 2) Set the Location as Chennai 29 | WebElement ele1 = driver.findElementByXPath("//input[@id='city']"); 30 | ele1.click(); 31 | ele1.sendKeys("Chennai"); 32 | Thread.sleep(1000); 33 | driver.findElementByXPath("//li[@id='Chennai']").click(); 34 | Thread.sleep(1000); 35 | 36 | 37 | // 3) Click Auto Care in the left menu 38 | WebDriverWait wait = new WebDriverWait(driver,30); 39 | WebElement ele2 = driver.findElementByXPath("//span[text()='Auto care']"); 40 | wait.until(ExpectedConditions.elementToBeClickable(ele2)); 41 | ele2.click(); 42 | 43 | // 4) Click Car Repair 44 | WebElement ele3 = driver.findElementByXPath("//span[text()='Car Repair']"); 45 | wait.until(ExpectedConditions.elementToBeClickable(ele3)); 46 | ele3.click(); 47 | 48 | // 5) Click Car Brand as Hyundai 49 | WebElement ele4 = driver.findElementByXPath("//span[@class='redstr']//following-sibling::span[text()='Hyundai']"); 50 | ele4.click(); 51 | 52 | // 6) Click Make as Hyundai Xcent 53 | WebElement ele5 = driver.findElementByXPath("//span[@class='redstr']//following-sibling::span[text()='Hyundai Xcent']"); 54 | builder.moveToElement(ele5).perform(); 55 | builder.click(ele5).perform(); 56 | // ele5.click(); 57 | Thread.sleep(4000); 58 | 59 | //// 7) Click on Location and Enter Porur 60 | // WebElement pop = driver.findElementByXPath("//section[@id='best_deal_div']//span[text()='X']"); 61 | // if (pop.isDisplayed()) pop.click(); 62 | // Thread.sleep(400); 63 | // driver.findElementByXPath("//li[@id='location']//a").click(); 64 | // Thread.sleep(400); 65 | // 66 | //// 8) Select Porur from the dropdown list 67 | // driver.findElementByXPath("//input[@id='sortbydist']").sendKeys("Porur"); 68 | // Thread.sleep(400); 69 | // WebElement pl = driver.findElementByXPath("(//span[@id='sbd']//a)[1]"); 70 | // builder.click(pl).perform(); 71 | // Thread.sleep(1400); 72 | // 73 | //// 9) Select Distance starting from 1 km 74 | // driver.findElementByXPath("//li[@id='distance']").click(); 75 | // Thread.sleep(400); 76 | // WebElement dt = driver.findElementByXPath("//li[@id='distance']/span/a[text()='1 km']"); 77 | // builder.click(dt).perform(); 78 | // Thread.sleep(1400); 79 | 80 | // 10) Identify all the Service Center having Ratings >=4.5 and Votes >=50 81 | List li = driver.findElementsByXPath("//li[@class='cntanr']"); 82 | Map service = new HashMap(); 83 | 84 | for (int i = 0; i < li.size();i++) 85 | { 86 | 87 | String name = li.get(i).findElement(By.tagName("h2")).getText(); 88 | // System.out.println("Name is : " + name); 89 | WebElement el = driver.findElementByXPath("((//li[@class='cntanr'])["+ (i+1) +"])//p[@class='newrtings ']/a/span[1]"); 90 | // li.get(i).findElement(By.xpath("//p[@class='newrtings ']/a/span[1]")); 91 | // System.out.println("Rating is : " + el.getText()); 92 | double rt = Double.parseDouble(el.getText()); 93 | WebElement el2 = driver.findElementByXPath("((//li[@class='cntanr'])["+ (i+1) +"])//p[@class='newrtings ']//span[@class='rt_count lng_vote']"); 94 | // li.get(i).findElement(By.xpath("//p[@class='newrtings ']//span[@class='rt_count lng_vote']")); 95 | // System.out.println("Vote is : " + el2.getText()); 96 | int vote = Integer.parseInt(el2.getText().replaceAll(" Votes", "")); 97 | 98 | if (rt >= 4.5d && vote >=50) { 99 | System.out.println(""); 100 | System.out.print("Name is : " + name); 101 | System.out.print(" --- Rating is : " + rt); 102 | System.out.print(" --- Vote is : " + vote); 103 | service.put(name, ""); 104 | } 105 | 106 | } 107 | 108 | // 11) Save all the Service Center name and Phone number matching the above condition in excel 109 | for (Entry eachEntry: service.entrySet()) 110 | { 111 | eachEntry.getKey(); 112 | eachEntry.getValue(); 113 | } 114 | 115 | // 12) Close the browser 116 | // driver.close(); 117 | System.out.println(" *** Program Ends ***"); 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC011SnapDeal.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import org.openqa.selenium.Keys; 9 | import org.openqa.selenium.WebElement; 10 | import org.openqa.selenium.support.ui.ExpectedConditions; 11 | import org.openqa.selenium.support.ui.WebDriverWait; 12 | 13 | import base.api.ProjectSpecificMethods; 14 | 15 | public class TC011SnapDeal extends ProjectSpecificMethods{ 16 | 17 | public static void main(String[] args) throws IOException, InterruptedException { 18 | 19 | // 1) Go to https://www.snapdeal.com/ 20 | String URL = "https://www.snapdeal.com/"; 21 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 22 | // psm.killprocess(true,true,true); 23 | psm.launch(URL); 24 | 25 | // 2) Mouse hover on Toys, Kids Fashion & more and click on Toys 26 | WebDriverWait wait = new WebDriverWait(driver,30); 27 | WebElement ele1 = driver.findElementByXPath("//span[text()=\"Toys, Kids' Fashion & more\"]"); 28 | wait.until(ExpectedConditions.elementToBeClickable(ele1)); 29 | builder.moveToElement(ele1).perform(); 30 | 31 | // 3) Click Educational Toys in Toys & Games 32 | WebElement ele2 = driver.findElementByXPath("//span[text()='Educational Toys']"); 33 | wait.until(ExpectedConditions.elementToBeClickable(ele2)); 34 | ele2.click(); 35 | Thread.sleep(5000); 36 | 37 | // 4) Click the customer rating 4 star up 38 | WebElement ele3 = driver.findElementByXPath("//label[@for='avgRating-4.0']"); 39 | wait.until(ExpectedConditions.elementToBeClickable(ele3)); 40 | ele3.click(); 41 | Thread.sleep(3000); 42 | 43 | // 5) Click the offer as 40-50 44 | WebElement ele4 = driver.findElementByXPath("//a[text()=' 40 - 50']/parent::label"); 45 | wait.until(ExpectedConditions.elementToBeClickable(ele4)); 46 | ele4.click(); 47 | Thread.sleep(3000); 48 | 49 | // 6) Check the availability for the pincode 50 | WebElement ele5 = driver.findElementByXPath("//div[@class='pincode-enter js-pincode-enter']/input"); 51 | wait.until(ExpectedConditions.elementToBeClickable(ele5)); 52 | ele5.sendKeys("620014"); 53 | driver.findElementByXPath("//div[@class='pincode-enter js-pincode-enter']/button").click(); 54 | Thread.sleep(3000); 55 | 56 | // 7) Click the Quick View of the first product 57 | WebElement ele6 = driver.findElementByXPath("(//picture[@class='picture-elem'])[1]"); 58 | wait.until(ExpectedConditions.elementToBeClickable(ele6)); 59 | builder.moveToElement(ele6).perform(); 60 | driver.findElementByXPath("(//picture[@class='picture-elem'])[1]/ancestor::div[@class='product-tuple-image ']//div[contains(text(),'Quick View')]").click(); 61 | Thread.sleep(2000); 62 | 63 | // 8) Click on View Details 64 | driver.findElementByXPath("//a[contains(text(),'view details')]").click(); 65 | Thread.sleep(2000); 66 | 67 | // 9) Capture the Price of the Product and Delivery Charge 68 | String price = driver.findElementByXPath("//span[@class='payBlkBig']").getText(); 69 | System.out.println("Price is : "+price); 70 | 71 | // 10) Validate the You Pay amount matches the sum of (price+deliver charge) 72 | 73 | // 11) Search for Sanitizer 74 | WebElement ele7 = driver.findElementByXPath("//input[@id='inputValEnter']"); 75 | wait.until(ExpectedConditions.elementToBeClickable(ele7)); 76 | ele7.sendKeys("Sanitizer"); 77 | Thread.sleep(500); 78 | ele7.sendKeys(Keys.ENTER); 79 | Thread.sleep(5000); 80 | 81 | // 12) Click on Product "BioAyurveda Neem Power Hand Sanitizer" 82 | driver.findElementByXPath("//p[contains(text(),'BioAyurveda Neem Power Hand Sanitizer')]").click(); 83 | Thread.sleep(3000); 84 | 85 | // 13) Capture the Price and Delivery Charge 86 | Set winH = driver.getWindowHandles(); 87 | List winL= new ArrayList(winH); 88 | driver.switchTo().window(winL.get(1)); 89 | String price1 = driver.findElementByXPath("//span[@class='payBlkBig']").getText(); 90 | System.out.println("Price of Sanitizer is : "+price1); 91 | 92 | // 14) Click on Add to Cart 93 | driver.findElementByXPath("(//span[text()='ADD TO CART'])[1]").click(); 94 | Thread.sleep(3000); 95 | // 15) Click on Cart 96 | driver.findElementByXPath("//div[@class='cartInner']").click(); 97 | Thread.sleep(3000); 98 | 99 | // 16) Validate the Proceed to Pay matches the total amount of both the products 100 | 101 | // 17) Close all the windows 102 | driver.close(); 103 | driver.switchTo().window(winL.get(0)); 104 | driver.close(); 105 | System.out.println(" *** Program Ends ***"); 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC012Carwale.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/src/main/java/testCases/TC012Carwale.java -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC013Shiksha.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import org.openqa.selenium.By; 7 | import org.openqa.selenium.WebElement; 8 | import org.openqa.selenium.support.ui.ExpectedConditions; 9 | import org.openqa.selenium.support.ui.Select; 10 | import org.openqa.selenium.support.ui.WebDriverWait; 11 | 12 | import base.api.ProjectSpecificMethods; 13 | 14 | public class TC013Shiksha extends ProjectSpecificMethods{ 15 | 16 | public static void main(String[] args) throws IOException, InterruptedException { 17 | 18 | // 1) Go to https://studyabroad.shiksha.com/ 19 | String URL = "https://studyabroad.shiksha.com/"; 20 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 21 | psm.killprocess(true, true, true); 22 | psm.launch(URL); 23 | 24 | // 2) Mouse over on Colleges and click MS in Computer Science &Engg under MS Colleges 25 | WebDriverWait wait = new WebDriverWait(driver,30); 26 | WebElement ele1 = driver.findElementByXPath("//div[@class='lgn-section']//label[text()='Colleges ']"); 27 | wait.until(ExpectedConditions.elementToBeClickable(ele1)); 28 | builder.moveToElement(ele1).perform(); 29 | 30 | WebElement ele2 = driver.findElementByXPath("//a[text()='MS in Computer Science &Engg']"); 31 | wait.until(ExpectedConditions.elementToBeClickable(ele2)); 32 | ele2.click(); 33 | 34 | // 3) Select GRE under Exam Accepted and Score 300 & Below 35 | WebElement ele3 = driver.findElementByXPath("//p[text()='GRE']/parent::label/span"); 36 | wait.until(ExpectedConditions.elementToBeClickable(ele3)); 37 | ele3.click(); 38 | 39 | WebElement okbtn = driver.findElementByXPath("//div[@class='tar']/a"); 40 | wait.until(ExpectedConditions.elementToBeClickable(okbtn)); 41 | if (okbtn.isDisplayed()) okbtn.click(); 42 | 43 | WebElement ele4 = driver.findElementByXPath("//p[text()='GRE']/parent::label/parent::li//select"); 44 | Thread.sleep(3000); 45 | Select options = new Select(ele4); 46 | options.selectByVisibleText("300 & below"); 47 | Thread.sleep(4000); 48 | 49 | // 4) Max 10 Lakhs under 1st year Total fees, USA under countries 50 | WebElement ele5 = driver.findElementByXPath("//p[text()='Max 10 Lakhs']/parent::label"); 51 | wait.until(ExpectedConditions.elementToBeClickable(ele5)); 52 | ele5.click(); 53 | // builder.click(ele5).perform(); 54 | Thread.sleep(4000); 55 | 56 | WebElement ele6 = driver.findElementByXPath("//a[text()='USA']/ancestor::label"); 57 | wait.until(ExpectedConditions.elementToBeClickable(ele6)); 58 | // builder.click(ele6).perform(); 59 | ele6.click(); 60 | Thread.sleep(4000); 61 | 62 | // 5) Select Sort By: Low to high 1st year total fees 63 | WebElement ele7 = driver.findElementByXPath("//select[@id='categorySorter']"); 64 | wait.until(ExpectedConditions.elementToBeClickable(ele7)); 65 | Select options1 = new Select(ele7); 66 | options1.selectByVisibleText("Low to high 1st year total fees"); 67 | 68 | // 6) Click Add to compare of the College having least fees with Public University, Scholarship and Accomadation 69 | List clgs = driver.findElementsByXPath("//div[@class='uni-course-details flLt']//div[3]"); 70 | 71 | for (int i =0; i< clgs.size(); i++) 72 | { 73 | List ptag = clgs.get(i).findElements(By.tagName("p")); 74 | if ((ptag.get(0).getAttribute("class")).equalsIgnoreCase("non-available") 75 | || (ptag.get(0).getAttribute("class")).equalsIgnoreCase("non-available") 76 | || (ptag.get(0).getAttribute("class")).equalsIgnoreCase("non-available")) 77 | { 78 | 79 | } 80 | else 81 | { 82 | driver.findElementByXPath("(//p[text()='Add to compare'])["+(i+1)+"]").click(); 83 | Thread.sleep(3000); 84 | break; 85 | } 86 | } 87 | 88 | // 7) Select the first college under Compare with similar colleges 89 | driver.findElementByXPath("//ul[@class='sticky-suggestion-list']//li[1]//span").click(); 90 | Thread.sleep(1000); 91 | 92 | // 8) Click on Compare College> 93 | driver.findElementByXPath("//strong[text()='Compare Colleges >']").click(); 94 | Thread.sleep(3000); 95 | 96 | // 9) Select When to Study as 2021 97 | driver.findElementByXPath("//strong[text()='2021']/ancestor::label/span").click(); 98 | Thread.sleep(3000); 99 | 100 | // 10) Select Preferred Countries as USA 101 | driver.findElementByXPath("//div[text()='Preferred Countries']").click(); 102 | Thread.sleep(1000); 103 | driver.findElementByXPath("//input[contains(@id,'USA_')]/parent::div//span").click(); 104 | Thread.sleep(1000); 105 | 106 | // 11) Select Level of Study as Masters 107 | driver.findElementByXPath("//strong[text()='Masters']/ancestor::label/span").click(); 108 | Thread.sleep(3000); 109 | 110 | // 12) Select Preferred Course as MS 111 | driver.findElementByXPath("//div[text()='Preferred Course']").click(); 112 | Thread.sleep(1000); 113 | driver.findElementByXPath("//li[text()='MS']").click(); 114 | Thread.sleep(1000); 115 | 116 | // 13) Select Specialization as "Computer Science & Engineering" 117 | driver.findElementByXPath("//div[text()='All specializations']").click(); 118 | Thread.sleep(1000); 119 | WebElement cse = driver.findElementByXPath("//li[text()='Computer Science & Engineering']"); 120 | builder.moveToElement(cse).perform(); 121 | Thread.sleep(100); 122 | cse.click(); 123 | Thread.sleep(1000); 124 | 125 | // 14) Click on Sign Up 126 | driver.findElementByXPath("//a[@id='signup']").click(); 127 | Thread.sleep(3000); 128 | 129 | // 15) Print all the warning messages displayed on the screen for missed mandatory fields 130 | String txt; 131 | List wrn = driver.findElementsByXPath("//div[@class='helper-text']"); 132 | for (int i = 0; i < wrn.size();i++) 133 | { 134 | txt = wrn.get(i).getText(); 135 | if (txt.contentEquals("")); 136 | else System.out.println("Warning Message : "+txt); 137 | } 138 | 139 | System.out.println(" *** Program Ends *** "); 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC014zalando.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Set; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | import org.openqa.selenium.Alert; 10 | import org.openqa.selenium.Keys; 11 | import org.openqa.selenium.WebElement; 12 | import org.openqa.selenium.chrome.ChromeDriver; 13 | import org.openqa.selenium.chrome.ChromeOptions; 14 | import org.openqa.selenium.support.ui.ExpectedConditions; 15 | import org.openqa.selenium.support.ui.WebDriverWait; 16 | 17 | import base.api.ProjectSpecificMethods; 18 | 19 | public class TC014zalando extends ProjectSpecificMethods{ 20 | 21 | public void clickElement(WebElement ele) 22 | { 23 | WebDriverWait wait = new WebDriverWait(driver,30); 24 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 25 | ele.click(); 26 | } 27 | 28 | public static void main(String[] args) throws InterruptedException, IOException { 29 | 30 | TC014zalando ce = new TC014zalando(); 31 | // 1) Go to https://www.zalando.com/ 32 | String URL = "https://www.zalando.com/"; 33 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 34 | psm.killprocess(true, true, true); 35 | options = new ChromeOptions(); 36 | options.addArguments("--disable-notifications"); 37 | System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver_81.exe"); 38 | System.setProperty("webdriver.chrome.silentOutput", "true"); 39 | driver = new ChromeDriver(options); 40 | driver.get(URL); 41 | 42 | // 2) Get the Alert text and print it 43 | Alert alert = driver.switchTo().alert(); 44 | String alt_txt = alert.getText(); 45 | System.out.println("Alert text is : "+alt_txt); 46 | 47 | // 3) Close the Alert box and click on Zalando.uk 48 | alert.accept(); 49 | driver.manage().window().maximize(); 50 | driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); 51 | 52 | ce.clickElement(driver.findElementByXPath("//a[text()='Zalando.uk']")); 53 | Thread.sleep(7000); 54 | 55 | // 4) Click Women--> Clothing and click Coat 56 | if (driver.findElementByXPath("//button[@class='uc-btn uc-btn-primary']").isDisplayed()) 57 | { 58 | Thread.sleep(3000); 59 | ce.clickElement(driver.findElementByXPath("//button[@class='uc-btn uc-btn-primary']")); 60 | } 61 | ce.clickElement(driver.findElementByXPath("//a[@class='z-navicat-header_gender']//span[text()='Women']")); 62 | 63 | ce.clickElement(driver.findElementByXPath("//span[text()='Clothing']")); 64 | 65 | // ce.clickElement(driver.findElementByXPath("//span[text()='Coats']")); 66 | ce.clickElement(driver.findElementByXPath("//ul[@role='group']//a[text()='Coats']")); 67 | Thread.sleep(3000); 68 | 69 | // 5) Choose Material as cotton (100%) and Length as thigh-length 70 | ce.clickElement(driver.findElementByXPath("//span[@data-label='Material']//parent::button")); 71 | ce.clickElement(driver.findElementByXPath("//span[text()='cotton (100%)']")); 72 | ce.clickElement(driver.findElementByXPath("//button[text()='Save']")); 73 | Thread.sleep(3000); 74 | 75 | ce.clickElement(driver.findElementByXPath("//span[@data-label='Length']//parent::button")); 76 | ce.clickElement(driver.findElementByXPath("//span[text()='thigh-length']")); 77 | ce.clickElement(driver.findElementByXPath("//button[text()='Save']")); 78 | Thread.sleep(3000); 79 | 80 | // 6) Click on Q/S designed by MANTEL - Parka coat 81 | ce.clickElement(driver.findElementByXPath("//div[text()='Q/S designed by']")); 82 | 83 | // 7) Check the availability for Color as Olive and Size as 'M' 84 | String color = driver.findElementByXPath("(//span[contains(text(),'Colour')]/parent::div/span)[2]").getText(); 85 | boolean mtchfnd = false; 86 | if (color.equalsIgnoreCase("navy")) 87 | { 88 | ce.clickElement(driver.findElementByXPath("(//img[@alt='olive'])[2]")); 89 | Thread.sleep(3000); 90 | System.out.println("Color is : "+driver.findElementByXPath("(//span[contains(text(),'Colour')]/parent::div/span)[2]").getText()); 91 | if (driver.findElementByXPath("//h2[text()='Out of stock']").isDisplayed()) 92 | { 93 | System.out.println(driver.findElementByXPath("//h2[text()='Out of stock']").getText()); 94 | ce.clickElement(driver.findElementByXPath("(//img[@alt='navy'])[2]")); 95 | Thread.sleep(3000); 96 | if (driver.findElementByXPath("(//span[text()='Standard delivery'])[1]").isDisplayed()) 97 | { 98 | mtchfnd = true; 99 | System.out.println(driver.findElementByXPath("(//span[text()='Standard delivery'])[1]").getText()); 100 | } 101 | } 102 | } 103 | 104 | // 8) If the previous preference is not available, check availability for Color Navy and Size 'M' 105 | if (mtchfnd == true) 106 | { 107 | ce.clickElement(driver.findElementByXPath("//span[text()='Choose your size']/parent::button")); 108 | Thread.sleep(1000); 109 | ce.clickElement(driver.findElementByXPath("//span[text()='M']")); 110 | Thread.sleep(1000); 111 | // 9) Add to bag only if Standard Delivery is free 112 | ce.clickElement(driver.findElementByXPath("//span[text()='Add to bag']/parent::button")); 113 | Thread.sleep(1000); 114 | // 10) Mouse over on Your Bag and Click on "Go to Bag" 115 | WebElement cart = driver.findElementByXPath("//a[@class='z-navicat-header_navToolItemLink']"); 116 | builder.moveToElement(cart).perform(); 117 | Thread.sleep(1500); 118 | ce.clickElement(driver.findElementByXPath("//div[text()='Go to bag']/parent::a")); 119 | Thread.sleep(1000); 120 | 121 | // 11) Capture the Estimated Deliver Date and print 122 | WebElement dd = driver.findElementByXPath("//div[@data-id='delivery-estimation']/span"); 123 | System.out.println("Delivery Date : "+dd.getText()); 124 | 125 | // 12) Mouse over on FREE DELIVERY & RETURNS*, get the tool tip text and print 126 | WebElement tooltip = driver.findElementByXPath("//a[text()='Free delivery & returns*']"); 127 | builder.moveToElement(tooltip).perform(); 128 | Thread.sleep(200); 129 | String tt = tooltip.getAttribute("title"); 130 | System.out.println("Tool Tip : "+tt); 131 | ce.clickElement(tooltip); 132 | Thread.sleep(1000); 133 | 134 | // 13) Click on Start chat in the Start chat and go to the new window 135 | ce.clickElement(driver.findElementByXPath("//span[text()='Start chat']")); 136 | Thread.sleep(9000); 137 | 138 | Set winL = driver.getWindowHandles(); 139 | List winH = new ArrayList(winL); 140 | 141 | driver.switchTo().window(winH.get(1)); 142 | 143 | // 14) Enter you first name and a dummy email and click Start Chat 144 | driver.findElementById("prechat_customer_name_id").sendKeys("Mathanvel"); 145 | driver.findElementById("prechat_customer_email_id").sendKeys("mathan@gmail.com"); 146 | ce.clickElement(driver.findElementByXPath("//span[text()='Start Chat']")); 147 | Thread.sleep(5000); 148 | 149 | // 15) Type Hi, click Send and print thr reply message and close the chat window. 150 | driver.findElementByXPath("//textarea[@id='liveAgentChatTextArea']").sendKeys("Hi",Keys.ENTER); 151 | Thread.sleep(4000); 152 | List chatopr = driver.findElementsByXPath("//span[@class='operator']//span[@class='messageText']"); 153 | String opr = chatopr.get(chatopr.size()).getText(); 154 | System.out.println("Last Chat : "+opr); 155 | 156 | System.out.println(" *** Program Ends ***"); 157 | } 158 | } 159 | 160 | } 161 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC015airbnb.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | import org.openqa.selenium.WebElement; 8 | import org.openqa.selenium.support.ui.ExpectedConditions; 9 | import org.openqa.selenium.support.ui.WebDriverWait; 10 | 11 | import base.api.ProjectSpecificMethods; 12 | 13 | public class TC015airbnb extends ProjectSpecificMethods{ 14 | 15 | public void clickElement(WebElement ele) 16 | { 17 | WebDriverWait wait = new WebDriverWait(driver,30); 18 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 19 | ele.click(); 20 | } 21 | 22 | public void typetext(WebElement ele,String txt) 23 | { 24 | WebDriverWait wait = new WebDriverWait(driver,30); 25 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 26 | ele.sendKeys(txt); 27 | } 28 | public static void main(String[] args) throws InterruptedException { 29 | 30 | TC015airbnb tc = new TC015airbnb(); 31 | // 1) Go to https://www.airbnb.co.in/ 32 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 33 | psm.launch("https://www.airbnb.co.in/"); 34 | Thread.sleep(4000); 35 | 36 | WebElement pop = driver.findElementByXPath("//button[@class='optanon-allow-all accept-cookies-button']"); 37 | if (pop.isDisplayed()) tc.clickElement(pop); 38 | 39 | // 2) Type Coorg in location and Select Coorg, Karnataka 40 | tc.typetext(driver.findElementByXPath("//input[@id='bigsearch-query-attached-query']"), "Coorg"); 41 | Thread.sleep(1000); 42 | tc.clickElement(driver.findElementByXPath("//div[text()='Coorg, Karnataka']")); 43 | Thread.sleep(1000); 44 | 45 | // 3) Select the Start Date as June 1st and End Date as June 5th 46 | tc.clickElement(driver.findElementByXPath("//div[text()='June 2020']/parent::div/parent::div//table//div[text()='1']")); 47 | tc.clickElement(driver.findElementByXPath("//div[text()='June 2020']/parent::div/parent::div//table//div[text()='5']")); 48 | Thread.sleep(1000); 49 | 50 | // 4) Select guests as 6 adults, 3 child and Click Search 51 | tc.clickElement(driver.findElementByXPath("//div[text()='Add guests']")); 52 | Thread.sleep(400); 53 | 54 | for (int i = 1 ; i <=6 ; i++) 55 | { 56 | tc.clickElement(driver.findElementByXPath("//div[@id='stepper-adults']//button[@aria-label='increase value']")); 57 | Thread.sleep(100); 58 | } 59 | 60 | for (int i = 1 ; i <=3 ; i++) 61 | { 62 | tc.clickElement(driver.findElementByXPath("//div[@id='stepper-children']//button[@aria-label='increase value']")); 63 | Thread.sleep(100); 64 | } 65 | tc.clickElement(driver.findElementByXPath("//span[text()='Search']")); 66 | Thread.sleep(3000); 67 | 68 | // 5) Click Cancellation flexibility and enable the filter and Save 69 | tc.clickElement(driver.findElementByXPath("(//span[text()='Cancellation flexibility'])[1]")); 70 | Thread.sleep(2000); 71 | tc.clickElement(driver.findElementByXPath("//button[@id='filterItem-switch-flexible_cancellation-true']")); 72 | tc.clickElement(driver.findElementByXPath("//button[@id='filter-panel-save-button']")); 73 | Thread.sleep(3000); 74 | 75 | // 6) Select Type of Place as Entire Place and Save 76 | tc.clickElement(driver.findElementByXPath("(//span[text()='Type of place'])[1]")); 77 | Thread.sleep(2000); 78 | tc.clickElement(driver.findElementByXPath("//input[@name='Entire place']//following-sibling::span")); 79 | tc.clickElement(driver.findElementByXPath("//button[@id='filter-panel-save-button']")); 80 | Thread.sleep(3000); 81 | 82 | // 7) Set Min price as 3000 and max price as 5000 83 | tc.clickElement(driver.findElementByXPath("(//span[text()='Price'])[1]")); 84 | Thread.sleep(2000); 85 | WebElement min = driver.findElementByXPath("//input[@id='price_filter_min']"); 86 | min.clear(); 87 | tc.typetext(min, "3000"); 88 | Thread.sleep(200); 89 | WebElement max = driver.findElementByXPath("//input[@id='price_filter_max']"); 90 | max.clear(); 91 | tc.typetext(max, "5000"); 92 | tc.clickElement(driver.findElementByXPath("//button[@id='filter-panel-save-button']")); 93 | Thread.sleep(3000); 94 | 95 | // 8) Click More Filters and set 3 Bedrooms and 3 Bathrooms 96 | tc.clickElement(driver.findElementByXPath("(//span[text()='More filters'])[1]")); 97 | Thread.sleep(2000); 98 | for (int i = 1 ; i <=3 ; i++) 99 | { 100 | tc.clickElement(driver.findElementByXPath("//div[text()='Beds']/parent::div/parent::div//button[@aria-label='increase value']")); 101 | Thread.sleep(100); 102 | } 103 | for (int i = 1 ; i <=3 ; i++) 104 | { 105 | tc.clickElement(driver.findElementByXPath("//div[text()='Bedrooms']/parent::div/parent::div//button[@aria-label='increase value']")); 106 | Thread.sleep(100); 107 | } 108 | 109 | // 9) Check the Amenities with Kitchen, Facilities with Free parking on premisses, Property as House and Host Language as English 110 | // and click on Stays only when stays available 111 | tc.clickElement(driver.findElementByXPath("//input[@name='Kitchen']/parent::span//span")); 112 | Thread.sleep(100); 113 | tc.clickElement(driver.findElementByXPath("//input[@name='Free parking on premises']/parent::span//span")); 114 | Thread.sleep(100); 115 | tc.clickElement(driver.findElementByXPath("//input[@name='House']/parent::span//span")); 116 | Thread.sleep(100); 117 | tc.clickElement(driver.findElementByXPath("//input[@name='English']/parent::span//span")); 118 | Thread.sleep(100); 119 | String exp = "//button[matches(text(),'Show [1-9]+ stay')]"; 120 | tc.clickElement(driver.findElementByXPath(exp)); 121 | Thread.sleep(3000); 122 | 123 | // 10) Click Prahari Nivas, the complete house 124 | tc.clickElement(driver.findElementByXPath("(//a[@aria-label='Prahari Nivas, the complete house'])[1]")); 125 | Thread.sleep(5000); 126 | 127 | // 11) Click on "Show all * amenities" 128 | Set winL = driver.getWindowHandles(); 129 | List winH = new ArrayList(winL); 130 | driver.switchTo().window(winH.get(1)); 131 | 132 | tc.clickElement(driver.findElementByXPath("//div[text()='Amenities']//ancestor::section[1]//button")); 133 | Thread.sleep(2000); 134 | 135 | // 12) Print all the Not included amenities 136 | List nincl = driver.findElementsByXPath("//div[text()='Not included']//ancestor::section[1]//del"); 137 | System.out.println("Not Included Amenities : "); 138 | for (int i =0; i < nincl.size();i++) 139 | { 140 | System.out.println(nincl.get(i).getText()); 141 | } 142 | tc.clickElement(driver.findElementByXPath("(//button[@aria-label='Close'])[2]")); 143 | Thread.sleep(1000); 144 | 145 | // 13) Verify the Check-in date, Check-out date and Guests 146 | String chkin = driver.findElementByXPath("//input[@id='checkin']/parent::div//div").getText(); 147 | String chkout = driver.findElementByXPath("//input[@id='checkout']/parent::div//div").getText(); 148 | 149 | if (chkin.contentEquals("6/1/2020") && chkout.contentEquals("6/5/2020")) 150 | System.out.println("Dates matches"); 151 | else System.out.println("Dates doesnt match"); 152 | 153 | tc.clickElement(driver.findElementByXPath("//span[text()='Guests']//ancestor::div[1]//button//span[contains(text(),'guests')]")); 154 | Thread.sleep(1000); 155 | String adult = driver.findElementByXPath("//div[text()='Adults']//ancestor::div[3]//div[@aria-hidden='true']").getText(); 156 | String children = driver.findElementByXPath("//div[text()='Children']//ancestor::div[3]//div[@aria-hidden='true']").getText(); 157 | 158 | if (Integer.parseInt(adult)== 6 && Integer.parseInt(children)== 3) 159 | System.out.println("Guest matches"); 160 | else System.out.println("Guest doesnt match"); 161 | 162 | // 14) Read all the Sleeping arrangements and Print 163 | List slpargn = driver.findElementsByXPath("//div[text()='Sleeping arrangements']/ancestor::section[1]//div[@aria-hidden='true']"); 164 | System.out.println("Sleeping arrangements : "); 165 | for (int i =0; i < slpargn.size();i++) 166 | { 167 | System.out.println(slpargn.get(i).getText()); 168 | } 169 | // 15) Close all the browsers 170 | driver.close(); 171 | driver.switchTo().window(winH.get(0)); 172 | driver.close(); 173 | System.out.println(" *** Program Ends ***"); 174 | } 175 | 176 | } 177 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC016ajio.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.IOException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import org.openqa.selenium.WebElement; 9 | import org.openqa.selenium.support.ui.ExpectedConditions; 10 | import org.openqa.selenium.support.ui.Select; 11 | import org.openqa.selenium.support.ui.WebDriverWait; 12 | 13 | import base.api.ProjectSpecificMethods; 14 | 15 | public class TC016ajio extends ProjectSpecificMethods{ 16 | 17 | public void clickElement(WebElement ele) 18 | { 19 | WebDriverWait wait = new WebDriverWait(driver,30); 20 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 21 | ele.click(); 22 | } 23 | 24 | public void typetext(WebElement ele,String txt) 25 | { 26 | WebDriverWait wait = new WebDriverWait(driver,30); 27 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 28 | ele.sendKeys(txt); 29 | } 30 | public static void main(String[] args) throws InterruptedException, IOException { 31 | 32 | // 1) Go to https://www.ajio.com/ 33 | TC016ajio tc = new TC016ajio(); 34 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 35 | psm.killprocess(true, false, false); 36 | psm.launch("https://www.ajio.com/shop/sale"); 37 | Thread.sleep(4000); 38 | 39 | WebElement pop = driver.findElementByXPath("//button[text()='Allow Location']"); 40 | if (pop.isDisplayed()) tc.clickElement(pop); 41 | 42 | // 2) Enter Bags in the Search field and Select Bags in Women Handbags 43 | WebElement ele1 = driver.findElementByXPath("//input[@name='searchVal']"); 44 | tc.typetext(ele1, "bag"); 45 | Thread.sleep(200); 46 | tc.clickElement(driver.findElementByXPath("//button[@class='rilrtl-button']")); 47 | Thread.sleep(4000); 48 | tc.clickElement(driver.findElementByXPath("//input[@id='Women']/parent::div//label")); 49 | Thread.sleep(2000); 50 | tc.clickElement(driver.findElementByXPath("//input[@id='Women - Handbags']/parent::div//label")); 51 | Thread.sleep(2000); 52 | 53 | // 3) Click on five grid and Select SORT BY as "What's New" 54 | tc.clickElement(driver.findElementByXPath("//div[@class='five-grid-container ']")); 55 | Thread.sleep(2000); 56 | 57 | WebElement ele2 = driver.findElementByXPath("//div[@class='filter-dropdown']"); 58 | Select options = new Select(ele2); 59 | options.selectByVisibleText("What's New"); 60 | Thread.sleep(2000); 61 | 62 | // 4) Enter Price Range Min as 2000 and Max as 5000 63 | tc.clickElement(driver.findElementByXPath("//span[text()='price']")); 64 | tc.typetext(driver.findElementByXPath("//input[@id='minPrice']"), "2000"); 65 | tc.typetext(driver.findElementByXPath("//input[@id='maxPrice']"), "5000"); 66 | tc.clickElement(driver.findElementByXPath("//button[@class='rilrtl-button ic-toparw']")); 67 | Thread.sleep(2000); 68 | 69 | // 5) Click on the product "Puma Ferrari LS Shoulder Bag" 70 | tc.clickElement(driver.findElementByXPath("//div[text()='Ferrari LS Shoulder Bag']")); 71 | Thread.sleep(3000); 72 | 73 | Set winL = driver.getWindowHandles(); 74 | List winH = new ArrayList(winL); 75 | driver.switchTo().window(winH.get(1)); 76 | 77 | // 6) Verify the Coupon code for the price above 2690 is applicable for your product, if applicable the get the Coupon Code and Calculate the discount price for the coupon 78 | WebElement ele3 = driver.findElementByXPath("//div[@class='promo-title']"); 79 | if (ele3.isDisplayed()) 80 | { 81 | String dicpr = driver.findElementByXPath("//div[@class='promo-discounted-price']//span").getText(); 82 | int discp = Integer.parseInt(dicpr.replaceAll("\\D", "")); 83 | String orgprc = driver.findElementByXPath("//div[@class='prod-sp']").getText(); 84 | int orgpc = Integer.parseInt(orgprc); 85 | int pay = orgpc - discp; 86 | System.out.println("Original amount is : " + orgpc); 87 | System.out.println("Discount amount is : " + discp); 88 | System.out.println("payable amount is : " + pay); 89 | } 90 | 91 | // 7) Check the availability of the product for pincode 560043, print the expected delivery date if it is available 92 | tc.clickElement(driver.findElementByXPath("//span[text()='Enter pin-code to know estimated delivery date.']")); 93 | tc.typetext(driver.findElementByXPath("//input[@name='pincode']"), "560043"); 94 | tc.clickElement(driver.findElementByXPath("//button[text()='CONFIRM PINCODE']")); 95 | 96 | // 8) Click on Other Informations under Product Details and Print the Customer Care address, phone and email 97 | tc.clickElement(driver.findElementByXPath("//div[text()='Other information']")); 98 | String info = driver.findElementByXPath("//span[text()='Customer Care Address']/parent::li/span[3]").getText(); 99 | System.out.println("Customer care Info : "+info); 100 | 101 | // 9) Click on ADD TO BAG and then GO TO BAG 102 | tc.clickElement(driver.findElementByXPath("//span[text()='ADD TO BAG']")); 103 | Thread.sleep(1000); 104 | tc.clickElement(driver.findElementByXPath("//span[text()='GO TO BAG']")); 105 | 106 | // 10) Check the Order Total before apply coupon 107 | String ordttl1 = driver.findElementByXPath("//span[@class='price-value bold-font']").getText(); 108 | System.out.println("Order Total : "+ordttl1); 109 | 110 | // 11) Enter Coupon Code and Click Apply 111 | tc.typetext(driver.findElementByXPath("//input[@id='couponCodeInput']"), "EPIC"); 112 | tc.clickElement(driver.findElementByXPath("//button[text()='Apply']")); 113 | 114 | // 12) Verify the Coupon Savings amount(round off if it in decimal) under Order Summary and the matches the amount calculated in Product details 115 | String ordttl2 = driver.findElementByXPath("//span[@class='price-value bold-font']").getText(); 116 | System.out.println("Order Total : "+ordttl2); 117 | 118 | int t1 = (int) Math.ceil(Double.parseDouble(ordttl1)); 119 | int t2 = (int) Math.ceil(Double.parseDouble(ordttl2)); 120 | 121 | if (t1 == t2) System.out.println("Amount matches : "+t1 + " : "+t2); 122 | else System.out.println("Amount not matches : "+t1 + " : "+t2); 123 | 124 | // 13) Click on Delete and Delete the item from Bag 125 | tc.clickElement(driver.findElementByXPath("//div[@class='product-delete']/div")); 126 | tc.clickElement(driver.findElementByXPath("//div[text()='DELETE']")); 127 | 128 | // 14) Close all the browsers 129 | driver.close(); 130 | driver.switchTo().window(winH.get(0)); 131 | driver.close(); 132 | System.out.println(" *** Program Ends ***"); 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /Practice/src/main/java/testCases/TC017azure.java: -------------------------------------------------------------------------------- 1 | package testCases; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.openqa.selenium.Keys; 7 | import org.openqa.selenium.WebElement; 8 | import org.openqa.selenium.support.ui.ExpectedConditions; 9 | import org.openqa.selenium.support.ui.Select; 10 | import org.openqa.selenium.support.ui.WebDriverWait; 11 | 12 | import base.api.ProjectSpecificMethods; 13 | 14 | public class TC017azure extends ProjectSpecificMethods{ 15 | public void clickElement(WebElement ele) 16 | { 17 | WebDriverWait wait = new WebDriverWait(driver,30); 18 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 19 | ele.click(); 20 | } 21 | 22 | public void typetext(WebElement ele,String txt) 23 | { 24 | WebDriverWait wait = new WebDriverWait(driver,30); 25 | wait.until(ExpectedConditions.elementToBeClickable(ele)); 26 | ele.sendKeys(txt); 27 | } 28 | 29 | public boolean isFileDownloaded(String downloadPath, String fileName) { 30 | boolean flag = false; 31 | File dir = new File(downloadPath); 32 | File[] dir_contents = dir.listFiles(); 33 | 34 | for (int i = 0; i < dir_contents.length; i++) { 35 | if (dir_contents[i].getName().equals(fileName)) 36 | return flag=true; 37 | } 38 | return flag; 39 | } 40 | 41 | public static void main(String[] args) throws InterruptedException, IOException { 42 | 43 | // Ref : https://github.com/TestLeafPages/Research/blob/master/PdfFileDownload.java 44 | // 1) Go to https://azure.microsoft.com/en-in/ 45 | TC017azure tc = new TC017azure(); 46 | ProjectSpecificMethods psm = new ProjectSpecificMethods(); 47 | psm.killprocess(true, false, false); 48 | psm.launch("https://azure.microsoft.com/en-in/"); 49 | Thread.sleep(4000); 50 | 51 | // 2) Click on Pricing 52 | tc.clickElement(driver.findElementByXPath("//a[@id='navigation-pricing']")); 53 | 54 | // 3) Click on Pricing Calculator 55 | tc.clickElement(driver.findElementByXPath("//a[contains(text(),'Pricing calculator')]")); 56 | 57 | // 4) Click on Containers 58 | tc.clickElement(driver.findElementByXPath("//button[text()='Containers']")); 59 | 60 | // 5) Select Container Instances 61 | tc.clickElement(driver.findElementByXPath("(//span[@class='product']//span[text()='Container Instances'])[2]")); 62 | 63 | // 6) Click on Container Instance Added View 64 | tc.clickElement(driver.findElementByXPath("//div[text()='Container Instances added.']//a")); 65 | 66 | // 7) Select Region as "South India" 67 | WebElement rgn = driver.findElementByXPath("//select[@name='region']"); 68 | Select actions = new Select(rgn); 69 | actions.selectByVisibleText("South India"); 70 | Thread.sleep(3000); 71 | // 8) Set the Duration as 180000 seconds 72 | WebElement dur = driver.findElementByXPath("//label[text()='Seconds']/parent::div/input"); 73 | dur.clear(); 74 | dur.sendKeys(Keys.CONTROL + "a"); 75 | dur.sendKeys(Keys.DELETE); 76 | tc.typetext(dur, "180000"); 77 | 78 | // 9) Select the Memory as 4GB 79 | WebElement mem = driver.findElementByXPath("//select[@name='memory']"); 80 | Select actions1 = new Select(mem); 81 | actions1.selectByVisibleText("4 GB"); 82 | Thread.sleep(3000); 83 | // 10) Enable SHOW DEV/TEST PRICING 84 | tc.clickElement(driver.findElementByXPath("//button[@id='devtest-toggler']")); 85 | 86 | // 11) Select Indian Rupee as currency 87 | WebElement curr = driver.findElementByXPath("//select[@class='select currency-dropdown']"); 88 | Select actions2 = new Select(curr); 89 | actions2.selectByValue("INR"); 90 | 91 | // 12) Print the Estimated monthly price 92 | String emp = driver.findElementByXPath("((//h3[text()='Estimated monthly cost']/ancestor::div[2]//div)[2]//span)[4]").getText(); 93 | System.out.println("Estimated monthly price : "+emp); 94 | 95 | // 13) Click on Export to download the estimate as excel 96 | tc.clickElement(driver.findElementByXPath("//h3[text()='Estimated monthly cost']/parent::div//button[text()='Export']")); 97 | Thread.sleep(3000); 98 | 99 | // 14) Verify the downloded file in the local folder 100 | boolean fd1 = tc.isFileDownloaded("C:\\Users\\BM\\Downloads\\", "ExportedEstimate.xlsx"); 101 | if (fd1) System.out.println("ExportedEstimate.xlsx - File Downloaded"); 102 | else System.out.println("ExportedEstimate.xlsx - File not Downloaded"); 103 | Thread.sleep(3000); 104 | 105 | // 15) Navigate to Example Scenarios and Select CI/CD for Containers 106 | WebElement ele1 = driver.findElementByXPath("//a[text()='Example Scenarios']"); 107 | builder.moveToElement(ele1).perform(); 108 | builder.click(ele1).perform(); 109 | 110 | tc.clickElement(driver.findElementByXPath("//button[@title='CI/CD for Containers']")); 111 | Thread.sleep(3000); 112 | // 16) Click Add to Estimate 113 | WebElement ele2 = driver.findElementByXPath("//button[text()='Add to estimate']"); 114 | builder.moveToElement(ele2).perform(); 115 | // builder.click(ele2).perform(); 116 | ele2.click(); 117 | Thread.sleep(3000); 118 | 119 | // 17) Change the Currency as Indian Rupee 120 | WebElement curr1 = driver.findElementByXPath("//select[@class='select currency-dropdown']"); 121 | Select actions3 = new Select(curr1); 122 | actions3.selectByValue("INR"); 123 | 124 | // 18) Enable SHOW DEV/TEST PRICING 125 | tc.clickElement(driver.findElementByXPath("//button[@id='devtest-toggler']")); 126 | 127 | // 19) Export the Estimate 128 | tc.clickElement(driver.findElementByXPath("//h3[text()='Estimated monthly cost']/parent::div//button[text()='Export']")); 129 | Thread.sleep(3000); 130 | 131 | // 20) Verify the downloded file in the local folder 132 | boolean fd2 = tc.isFileDownloaded("C:\\Users\\BM\\Downloads\\", "ExportedEstimate (1).xlsx"); 133 | if (fd2) System.out.println("ExportedEstimate (1).xlsx - File Downloaded"); 134 | else System.out.println("ExportedEstimate (1).xlsx - File not Downloaded"); 135 | } 136 | 137 | } 138 | -------------------------------------------------------------------------------- /Practice/target/classes/base/api/ProjectSpecificMethods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/base/api/ProjectSpecificMethods.class -------------------------------------------------------------------------------- /Practice/target/classes/base/api/ReadWriteExcel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/base/api/ReadWriteExcel.class -------------------------------------------------------------------------------- /Practice/target/classes/base/api/tempDelete.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/base/api/tempDelete.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J001CountPalindrome.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J001CountPalindrome.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J002String.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J002String.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J003May14.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J003May14.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J004May15.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J004May15.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J005May18.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J005May18.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J006May19.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J006May19.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J007May20.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J007May20.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J008May21.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J008May21.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J009May26.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J009May26.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J010May27.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J010May27.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J011May28.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J011May28.class -------------------------------------------------------------------------------- /Practice/target/classes/javaprgms/J012May29.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/javaprgms/J012May29.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC001.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC001.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC001Myntra.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC001Myntra.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC002Nykaa.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC002Nykaa.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC003MakeMyTrip.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC003MakeMyTrip.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC004Hp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC004Hp.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC005Postman.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC005Postman.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC006BigBasket.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC006BigBasket.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC007Honda.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC007Honda.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC008Pepperfry.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC008Pepperfry.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC009CrmCloud.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC009CrmCloud.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC010JustDial.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC010JustDial.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC011SnapDeal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC011SnapDeal.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC012Carwale.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC012Carwale.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC013Shiksha.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC013Shiksha.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC014zalando.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC014zalando.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC015airbnb.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC015airbnb.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC016ajio.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC016ajio.class -------------------------------------------------------------------------------- /Practice/target/classes/testCases/TC017azure.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmvvel/SeleniumPractice/964ce52b6d4728f7211117b63a47dbc10db30cfb/Practice/target/classes/testCases/TC017azure.class --------------------------------------------------------------------------------