New answers tagged testng
1
The id attribute of the <div> tag is dynamic which will change each time the webpage is accessed. In these cases you need to construct dynamic locator strategies as follows:
xpath
//div[starts-with(@id, 'post-body-')]/div/form/input
Note: The second <div> is the first/only child of it's parent, the <form> is the first/only child of it's ...
0
Please try to this one
package com.tests;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class IfExampleSelenium
{
@Testpublic void testPageTitle()
{
System.out.println("Launching Firefox browser..");
WebDriver driver = new FirefoxDriver();
...
Top 50 recent answers are included
Related Tags
testng × 344selenium-webdriver × 272
java × 142
automated-testing × 135
selenium2 × 30
test-automation-framework × 19
jenkins × 16
eclipse × 14
maven × 13
appium × 12
cucumber × 11
junit × 11
assert × 8
page-factory × 8
excel × 7
test-report × 7
browser-automation × 6
chromedriver × 6
data-driven × 6
test-management × 5
test-design × 5
page-objects × 5
pom × 5
xpath × 4
testcase × 3