Code:
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.support.ui.Select;
public class Trial {
public static void main(String[] args) throws ClassNotFoundException {
System.setProperty("webdriver.gecko.driver", "D:\\Selenium\\Gecko\\geckodriver.exe");
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("SeleniumProfile");
WebDriver driver=new FirefoxDriver(myprofile);
driver.get("http://10.235.80.98:8080/digite/Request?Key=siteadm_login");
driver.findElement(By.xpath("//*[@id='loginId']")).sendKeys("admin");
driver.findElement(By.xpath("//*[@id='password']")).sendKeys("111111");
WebElement button=driver.findElement(By.xpath("html/body/div[1]/section/div/div/div/form/p[3]/input"));
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();", button);
Thread.sleep(5000);
Select URLSelect=new Select(driver.findElement(By.id("selectURL")));
URLSelect.selectByValue("Integration Console");
Select jobSelect=new Select(driver.findElement(By.xpath("//*[@id='job']")));
jobSelect.selectByValue("Wipro Project Pre Process Adaptor");
driver.findElement(By.xpath("//*[@id='showSync_7004']")).click();
driver.quit();
} catch (Exception e) {
e.printStackTrace();
}
}
}
I have tried absolute xpath also for the same. But nothing I've tried seems to work. Help.