Hi,
I have a scenario where an alert box appears. I wanted to validate whether a specific alert message appears or not. I am verifying it as below:
Assert(Find.ByContent<HtmlControl>("locator").getValue(), "actual value");
where Locator is the alert message
Now the problem is , although the alert box doesn't appears at the UI level , but since the alert message is present at html script, my test passes . In actual scenario it should fail because alert box doesn't appear.
I think since ByContent<>() internally uses Javascript it is able to find the locators.
Please let me know how to fix this because this will pass all the test instead of failing it.
I have a scenario where an alert box appears. I wanted to validate whether a specific alert message appears or not. I am verifying it as below:
Assert(Find.ByContent<HtmlControl>("locator").getValue(), "actual value");
where Locator is the alert message
Now the problem is , although the alert box doesn't appears at the UI level , but since the alert message is present at html script, my test passes . In actual scenario it should fail because alert box doesn't appear.
I think since ByContent<>() internally uses Javascript it is able to find the locators.
Please let me know how to fix this because this will pass all the test instead of failing it.