I am using selenium and java for automation. I am adding new data. after a click on save, data will appear on the left side on the top list and I want to verify.
I want to get the first text "new aam pizza order" for verification that added data is saved or not.
my code :
public class Assigment4 {
String baseUrl="https:// signin";
WebDriver driver;
@BeforeTest
public void init() {
//chrome driver setup
System.setProperty("webdriver.chrome.driver","chromedriver.exe");
driver =new ChromeDriver();
driver.get(baseUrl);
driver.manage().window().maximize();
}
@Test(priority=2)
public void createOrderWithoutdata() {
driver.findElement(By.linkText("Create order")).click();
driver.findElement(By.id("intent-header-name")).sendKeys("new aam pizza order");
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
driver.findElement(By.xpath("//button[text()='Save']")).click();
}