I am a beginner in selenium, I am using java for that, I am getting a error saying Unable to locate element although that element is present in the web page.
Java Code:
WebDriver dChromedriver=new ChromeDriver();
dChromedriver.get("https://erp.mitwpu.edu.in/");
dChromedriver.manage().window().maximize();
WebElement txtPassword=dChromedriver.findElement(By.id("txtPassword")) ;
WebElement txtUserId=dChromedriver.findElement(By.id("txtUserId")) ;
txtUserId.sendKeys("S1032200787");
txtPassword.sendKeys("FynS@3XbZH6ZMWH");
//
WebDriverWait w =new WebDriverWait(dChromedriver, Duration.ofSeconds(30));
w.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='ReCaptchContainer']")));
dChromedriver.findElement(By.xpath("//div[@id='ReCaptchContainer']")).click();
// Thread.sleep(3000);
w.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("label#lblMessage")));
WebElement success_lablElement=dChromedriver.findElement(By.cssSelector("label#lblMessage"));
Assert.assertEquals(success_lablElement.getText(),"Success" );
dChromedriver.findElement(By.id("btnLogin")).click();
WebElement resultWebElement=dChromedriver.findElement(By.xpath("//nav[@class=\"mt-2\"]/ul/li[12]/a[@href=\"Examination/Report/StudentGradeCardDetail.aspx?MENU_CODE=Web_Result\"]"));
resultWebElement.click();
Thread.sleep(30000);
dChromedriver.findElement(By.cssSelector("input#btnshow")).click();
html code:
<div class="labelinfo col-md-12 col-sm-7 col-xs-12 padd6"> <input type="submit" name="btnshow" value="Show" onclick="return funValidation();" id="btnshow" class="btn btn-primary" style="">
<input type="submit" value="Show" onclick="return funValidation();" id="btnshow" class="btn btn-primary" style="">
</div>
