3-system engineer intro to python
package day1;
import java.ie.File;
import java.io.FileInputstream;
import java.ie. IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.apache.commons.ie.Fileutils;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi. xssf. usermodel.XSSFWorkbook;
import org.openga.selenium.By;
import org.openga.selenium.OutputType;
import org openga selenium. TakesScreenshot;
import org.openga.selenium.WebDriver;
import org.openga.selenium.WebElement;
import org.openga.selenium.support.ui.Select;
import org.testng.annotations.Test;
import org.testng. annotations. AfterCLass;
import org.testng. annotations. Beforelest;
import org.testng.annotations.AfterTest;
import org. testng. annotations. BeforeClass;
import org testng.annotations.Betoresuite:
import org.testng.annotations AfterSuite;
public class mocksubmit {
WebDriver driver=null;
@BeforeClass
public void setup() {
System setProperty "webdriver. chrome driver", "C");
driver manage). timeouts).implicitlyWait(10, TimeUnit.SECONDS);
driver .get ("");
driver.manage ().window().maximize();
@test
public void test() throws IOException{
driver. findElement (By.xpath("//*[@id=\'viewFcourse\']")). click();
System.out.println("Intro to Programming in python");
driver.switchTo(). alert);
driver. findElement (By.xpath("//[@id=cIpp\']")) . click();
driver.findElement (By.xpath("//[id=|indexE\ ]")). click();
List link = driver.findElements (By.tagName('")) ;
System.out.println("The number of Hyperliks are : "+link.size());
driver. findElement (By.xpath("/html/body/div[2]/div/div[1]/div[2]/label")).click();
driver. findElement (By.xpath("//[@id=|| btn2\ ]")) . click();
driver.findElement(By. xpath//[@id=\'name\' ]")) . sendkeys ("Jack");
driver. findElement (By. xpath("//[@id=\ email\ 1")) . sendkeys("jack@ivs.com");
driver. findElement(By.xpath("//*[@id=|'empRadio|\']")). click();
//
WebELement company=driver-findElement (By.xpath("//*[@id=cIpp\']"));
Select company1=new Select (company);
company1. selectByVisibleText("Infosys");
WebElement role=driver.findElement (By.xpath("//")) ;
Select rolel=new Select (role);
rolel. selectByValue("System Engineer");
driver. findElement (By.xpath("")) . click();
driver. findElement (By.xpath("")) . click();
FileInputStream fis=new FileInputStream(''");
XSSFWorkbook wb=new XSSFWorkbook (fis);
XSSFSheet sheet =wb.getSheetAt (0) ;
WebElement crdno-driver.findElement (By.xpath("'"));
crdno.sendkeys (sheet getRow(0) getCell(0). getStringCellValue());
WebElement cvv=driver.findElement(By.xpath(''') (By.xpath'");
cvv.sendkeys (sheet.getRow(0) getCell(1) getStringCellValue())
WebElement month=driver.findElement (By.xpath(null));
Select mon=new Select (month);
mon.selectByVisibleTextsheet.getRow(0). getCell (2). getStringCellValue());
WebElement year=driver. findElement (By.Xpath(null));
Select yr=new Select (year);
yr.selectByVisibleText(sheet.getRow(0). getCell(3). getStringCellValue());
wb.close();
driver findElement (By .xpath("")) . click();
System.out.printin("payment done congratulation jack for getting enrolled in this course. further");
WebElement home-driver.findElement (By.xpath(null));
if (home. isDisplayed()) {
System.out.println("Link for homepage is displayed");
}
else
System.out.println("Link for homepage is not available");
driver. findElement (By.Xpath("")) . click();
WebElement table= driver.findElement (By.xpath("")) ;
List rows =driver.findElements (By. tagName("tr")) ;
for (WebElement r: rows)
{
String row=r.getText();
}
FiteInputStream fisi-new FileInputStream("'');
XSSFWorkbook wb1=new XSSFWorkbook (fisi);
XSSFSheet sheet1 =wb1. getSheetAt (0) ;
for (int i-0; i<=sheet.getLastRowNum(); i++)
{
for (int j=1;j<=3;j++)
{
}
}
driver. findElement (By.xpath("'")). click();
TakesScreenshot ss = (TakesScreenshot) driver;
File srcFile =ss. getScreenshotAs(OutputType.FILE);
@AfterClass
public void tearDown()
{
driver. close );
driver.quit();
}
Top comments (0)