Its very hard specially when we have nested iframes to know in which iframe we are currently working.
also the situation comes when we want to know whether the element is present in the source code we are currently pointing to.
By using Assertion we can easily know it.
Also remember if the Assertions fails the script will Stop and will not execute the steps after assertions.
also the situation comes when we want to know whether the element is present in the source code we are currently pointing to.
By using Assertion we can easily know it.
Also remember if the Assertions fails the script will Stop and will not execute the steps after assertions.
assertTrue(driver.getPageSource().contains("Text-you-are-Looking-for"));
What is CWidgetButton ?
ReplyDeleteIt can be any string which you are looking for in the desired iframe
Delete