I'm trying to click a button inside a hikvision camera login page using internet explorer ( note that this website only works with IE) with eclipse this is the code for the button
<button class="btn btn-primary login-btn" type="button" ng-click="login()"><label class="ng-binding" ng-bind="oLan.login">Login</label></button>
<label class="ng-binding" ng-bind="oLan.login">Login</label>
Image:
This is my code , everything works fine but the button won't click.
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class test {
public static void main(String[] args) {
System.setProperty("webdriver.ie.driver","C:\\Users\\SAAD\\Downloads\\IEDriverServer_Win32_4.0.0\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://10.67.0.230");
driver.manage().window().maximize();
WebElement Username = driver.findElement(By.id("username"));
Username.click();
Username.sendKeys("admin");
WebElement Password = driver.findElement(By.id("password"));
Password.click();
Password.sendKeys("ezEqL7?Ss=g");
WebElement Login = driver.findElement(By.className("btn.btn-primary.login-btn"));
Login.click();
Also I have tried this xpath but still don't work
WebElement Login = driver.findElement(By.xpath("/html/body/div[1]/table/tbody/tr/td[2]/div/div[5]/button"));