I am creating a script that involved searching for a record and then updating the record. On the search screen, the user has the option of viewing advanced search options.
Use of Try Catch defies the very purpose of isdisplayed() used as If condition, one can write below code without using "if"
try{ driver.findElement(By.xpath(noRecordId)).isDisplayed(); //Put then statements here } Catch(Exception e) {//put else statement here.}