Improved clickOnMenuItem()