I have a scenario in which i have to click a particular element if it is presented in the page else i have to skip and click other element in the page.when i checked the presence of the element in the page using isdisplayed() function it is throwing error as below…
Can’t locate an element by this strategy: Locator map:
native content: “By.id: Close”
html content: “by id or name “closeButton””
I know that the particular element is not present over there that’s why gave in if block but still got the same error…
//code snippet
if (closeButton.isDisplayed()) {
closeButton.click();
}
else{
pauseButton.click(); //pausing the video
playButton.click(); //playing the video
doneButton.click(); //closing the video player
}
help me out