See, i’ll recommend you that this all is depends upon your take a look at circumstances that what eventualities are they following.
From my level, suppose that if take a look at case begin from that your admin has choose some variety of enter
and Choose
fields you then come to your Assembly Particular web page and right here you’ll rely the variety of all fields current right here, it means you already properly know that what fields will current right here with what numbers, so that you simply have to verify that fields.
Right here might this code assist you to:
Checklist factor=driver.findElements(By.tagName("choose"));
Assert.assertEquals(factor.measurement(), 2);
for(WebElement attr:factor)
{
Assert.assertEquals(attr.getAttribute("required"), "true");
}
Checklist element1=driver.findElements(By.tagName("enter"));
Assert.assertEquals(element1.measurement(), 1);
for(WebElement attr1:element1)
{
Assert.assertEquals(attr1.getAttribute("required"), "true");
}
And in second case if as a admin you haven’t chosen any fields you then already know that on Assembly Particular web page there shall be no fields, you then simply have to confirm that no enter
and choose
are current.
Right here might this code assist you-
Checklist factor=driver.findElements(By.tagName("choose"));
Assert.assertEquals(factor.isEmpty(), true);
Checklist element1=driver.findElements(By.tagName("enter"));
Assert.assertEquals(element1.isEmpty(), true);