@Test public void lab1(){ System.setProperty("webdriver.gecko.driver","C:\\testautomatisering\\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); driver.get("http://damberg.one/lab/lab1.html"); driver.findElement(By.xpath("//*[@id='Zington']")).click(); Assert.assertTrue(driver.findElement(By.id("result")).getText().equals("Zington")); driver.quit(); }
In this page, use the developer tools of your web browser to identify the “Open TSO” button on the row with the name “Zington” with the use of an XPath suitable for automation.
Bonus if the same XPath works in other browsers (note that some webkits inserts their own TBODY and THEAD part of tables).
Status | Company | |
---|---|---|
Active | ICA | |
Closed | WM-Data | |
Active | Zington | |
Active | Knowit | |
Passive | Angpanneforeningen |