package com.neoload.userpath; import static com.neotys.selenium.proxies.NLWebDriverFactory.addProxyCapabilitiesIfNecessary; import java.io.File; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import com.neotys.selenium.proxies.NLWebDriver; import com.neotys.selenium.proxies.NLWebDriverFactory; public class FirstCase { public static void main(String[] args) throws Exception { System.setProperty("webdriver.ie.driver", "C:\\Users\\hsengar\\Downloads\\IEDriverServer.exe"); final InternetExplorerDriver webDriver = new InternetExplorerDriver(NLWebDriverFactory.addProxyCapabilitiesIfNecessary(new DesiredCapabilities())); webDriver.manage().window().maximize(); // projectPath used to open NeoLoad project, null to use the currently // opened Project. final String projectPath = "\\\\int.cpaglobal.net\\UserData\\Users-INN\\hsengar\\Documents\\NeoLoad Projects\\5July2017\\5July2017.nlp"; NLWebDriver driver = NLWebDriverFactory.newNLWebDriver(webDriver, "SeleniumUserPath", projectPath); driver.startTransaction("Login"); driver.get("MY APPLICATION URL"); Thread.sleep(8000); driver.findElement(By.xpath("//input[@id='InputUsername']")).sendKeys("35577"); driver.findElement(By.xpath("//input[@id='InputPassword']")).sendKeys("demo"); driver.findElement(By.xpath("//button[@class='btn btn-primary']")).click(); Thread.sleep(10000); driver.startTransaction("SearchPAClick"); driver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS); driver.findElement(By.xpath("//li[8]/a/span[2]/translate")).click(); driver.findElement(By.xpath("//li[3]/ul/li[3]/a/span/span[2]")).click(); Thread.sleep(10000); driver.findElement(By.xpath("//input[@name='GeneralCriteria.CaseReference']")).sendKeys("test data"); driver.findElement(By.xpath("(//button[@type='button'])[2]")).click(); Thread.sleep(15000); driver.startTransaction("Logout"); driver.findElement(By.xpath("//a[@uib-tooltip='Account']")).click(); Thread.sleep(1000); driver.findElement(By.xpath("//translate[contains(text(),'Logout')]")).click(); driver.quit(); } }