My code is not functioning correctly and I need a better solution. The fast speed of execution makes it difficult for me to detect where the issue lies. Below is my current code:
public static void main(String[] args) {
//**********************************open ff
WebDriver driver=new FirefoxDriver();
//**************************************maximize ff
driver.manage().window().maximize();
Logger log = Logger.getLogger("devpinoyLogger");
driver.get("http://navvitistgvm.cloudapp.net/nvrppluginassist/Account/Login");
log.debug("entring username");
driver.findElement(By.xpath("//*[@id='UserName']")).sendKeys("rpadmin");
log.debug("entering password");
driver.findElement(By.xpath("//*[@id='Password']")).sendKeys("Password123");
log.debug("Clicking login");
driver.findElement(By.xpath("//*[@id='loginForm']/form/div[4]/div/input")).click();
log.debug("Clicking voucher");
driver.findElement(By.xpath("html/body/nav/div[2]/div[2]/ul/li[2]/a")).click();
log.debug("selecting search_voucher");
List<WebElement> elements=driver.findElements(By.id("VoucherType"));
elements.get(1).click(); //GC
driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[@id='main']/form[2]/div[2]/input[4]")).click();
driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[@id='main']/div[1]/span/a")).click();
}
}
I am in need of suggestions for improving the functionality of this code due to its unreliable performance at high speeds.