TanIlak
2 years agoContributor
Re: Unable to find an object
Hi,
I need to click a button multiple times in a page to load more contents untill the button gets disabled, if the button is disabled, I need to exit the process.
>> Sample code I have tried is:
var buttonObj =page.FindElement("xpath");
while(buttonObj.Visible==true)
{
buttonObj.click();
if(!page.FindElement("xpath"))
{
break;
}
}
After two iterations, the find element method that I highlighted fails and throws unable to find an object and gets logged in log file.
>> Any solution for my issues.