<file_sep>package Amazon;

		import java.util.concurrent.TimeUnit;

		import org.openqa.selenium.By;
		import org.openqa.selenium.Keys;
		import org.openqa.selenium.WebDriver;
		import org.openqa.selenium.chrome.ChromeDriver;
		import org.openqa.selenium.support.ui.Select;
		import org.testng.annotations.AfterMethod;
		import org.testng.annotations.BeforeMethod;
		import org.testng.annotations.Test;

		public class amazon {
			WebDriver driver;
			@BeforeMethod
			public void HpLappy() throws InterruptedException{
				System.setProperty("webdriver.chrome.driver","D:\\\\Testing\\\\chromedriver.exe");
				driver=new ChromeDriver();
				driver.manage().window().maximize();
				driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
				driver.get("http://www.amazon.in");
				try{
					Thread.sleep(1000);
				}catch(InterruptedException e){
					e.printStackTrace();
				}
				}
				@Test(priority=1)
				public void Login() throws InterruptedException
				{
				driver.findElement(By.xpath("//span[contains(text(),'Hello, Sign in')]")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@id='ap_email']")).sendKeys("<PASSWORD>",Keys.ENTER);
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@id='ap_password']")).sendKeys("<PASSWORD>",Keys.ENTER);
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@name='option' and @type='radio' and @value='sms']")).click();
				driver.findElement(By.xpath("//input[@id='continue']")).click();
				}
				@Test(priority=2)
				public void SearchItemandSelect() throws InterruptedException
				{
				driver.findElement(By.xpath("//input[@id='twotabsearchtextbox']")).sendKeys("t-shirts for men"+Keys.ENTER);
				Thread.sleep(4000);
				driver.findElement(By.xpath("//div[@class='sb_1LbkwDuT']//div[2]//div[1]//a[1]")).click();
				Thread.sleep(6000);
				Select dropdown=new Select(driver.findElement(By.xpath("//select[@name='dropdown_selected_size_name']")));
				dropdown.selectByVisibleText("L");
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@name='submit.buy-now']")).click();
				Thread.sleep(4000);
				}
				@Test(priority=3)
				public void PaymentThroughDebitCard() throws InterruptedException
				{
				driver.findElement(By.xpath("//input[@value='SelectableAddCreditCard']")).click();
				Thread.sleep(2000);
				driver.findElement(By.xpath("//input[@value='suneel']")).sendKeys("");
				Thread.sleep(2000);
				driver.findElement(By.xpath("//input[@name='addCreditCardNumber']")).sendKeys("918218025151");
				Thread.sleep(2000);
				Select dropdown1=new Select(driver.findElement(By.xpath("//span[@id='pp-Bf3YVu-81']//span[@class='a-button-text a-declarative']")));	
				dropdown1.selectByVisibleText("10");
				Thread.sleep(2000);
				Select dropdownYear=new Select(driver.findElement(By.xpath("//span[@id='pp-Bf3YVu-82']//span[@class='a-button-text a-declarative']")));
				dropdownYear.selectByVisibleText("2019");
				Thread.sleep(2000);
				driver.findElement(By.xpath("//input[@name='ppw-widgetEvent:AddCreditCardEvent']")).click();
				}
			    @Test(priority=4)
			    public void PaymentThroughNetBanking() throws InterruptedException
			    {
			    driver.findElement(By.xpath("//input[@type='radio' and @value='instrumentId=NetBanking&isExpired=false&paymentMethod=NB&tfxEligible=false']")).click();
		        Thread.sleep(2000);
		         Select drop=new Select(driver.findElement(By.xpath(".//span[@class='a-button a-button-dropdown']")));
		         drop.selectByVisibleText("HDFC Bank");
		        Thread.sleep(2000);
			    }
			    @AfterMethod
			    public void logout() 
			    {
			    	driver.close();
			    }
			

	}

<file_sep>package Flipkart;

		import java.util.ArrayList;
		import java.util.concurrent.TimeUnit;

		import org.eclipse.jdt.internal.compiler.ast.ThrowStatement;
		import org.openqa.selenium.By;
		import org.openqa.selenium.Keys;
		import org.openqa.selenium.WebDriver;
		import org.openqa.selenium.chrome.ChromeDriver;
		import org.openqa.selenium.support.ui.Select;
		import org.testng.annotations.BeforeMethod;
		import org.testng.annotations.Test;

		public class Flipkart {
			WebDriver driver;
			@BeforeMethod
			public void Shopping() throws InterruptedException{
				System.setProperty("webdriver.chrome.driver","D:\\\\Testing\\\\chromedriver.exe");
				driver=new ChromeDriver();
				driver.manage().window().maximize();
				driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
				driver.get("https://www.flipkart.com/");
				try{
					Thread.sleep(1000);
				}catch(InterruptedException e){
					e.printStackTrace();
				}
			}
				@Test
				public void Login() throws InterruptedException
					{
				driver.findElement(By.xpath("//input[@class='_2zrpKA _1dBPDZ']")).sendKeys("8218025151");
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@class='_2zrpKA _3v41xv _1dBPDZ']")).sendKeys("<PASSWORD>",Keys.ENTER);
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@placeholder='Search for products, brands and more']")).sendKeys("i phone 11 pro",Keys.ENTER);
				Thread.sleep(4000);
				driver.findElement(By.xpath("//div[contains(@class,'t-0M7P _2doH3V')]//div[3]//div[1]//div[1]//div[1]//a[1]//div[1]//div[1]//div[1]//div[1]//img[1]")).click();
				Thread.sleep(4000);
				ArrayList<String> windowTabs=new ArrayList<String>(driver.getWindowHandles());
				driver.switchTo().window(windowTabs.get(0));
				Thread.sleep(4000);
				driver.switchTo().window(windowTabs.get(1));
				Thread.sleep(4000);
				driver.findElement(By.xpath("//a[@class='_1TJldG _3c2Xi9']")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//button[@class='_2AkmmA _2Npkh4 _2kuvG8 _7UHT_c']")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//button[@class='_2AkmmA _I6-pD _7UHT_c']")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//button[@class='_2AkmmA _2Q4i61 _7UHT_c']")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//label[@class='_8J-bZE _3C6tOa _1syowc _2i24Q8 _1Icwrf']//div[@class='_6ATDKp']")).click();
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@name='cardNumber']")).sendKeys("25464645878455");
				Thread.sleep(4000);
				Select dd1=new Select(driver.findElement(By.xpath("//select[@name='month']")));
				dd1.selectByVisibleText("02");
				Thread.sleep(4000);
		        Select dd2=new Select(driver.findElement(By.xpath("//select[@name='year']")));
				dd2.selectByVisibleText("22");
				Thread.sleep(4000);
				driver.findElement(By.xpath("//input[@name='cvv']")).sendKeys("214");
				driver.findElement(By.xpath("//button[@class='_2AkmmA wbv91z _7UHT_c']")).click();

			

	}

}
