Consider I'm having one action button and this action button will give any of 2 results based on the input Condition. If the Invalid data is provided, then some validation error will be thrown in message table and If valid data is provided, then message table will not be exist and it will open another section. i.e Message table will be displayed only for the Invalid Data input and it will not be displayed for the Valid Data.
code:
driver.findElement(By.name("MessageTable")).isDisplayed()
If the Valid data is entered, then message table section will not be displayed and hence, getting an error as "no such element: Unable to locate element: {"method":"name","selector":"MessageTable"}". in the above code.
Could you please help me, how should i confirm messagetable is not present in the webpage?
