I am getting error when click on an element that appear after sometime

Sorry, I can not. StateElementReferenceException is thrown when the DOM is manipulated by JavaScript. It’s difficult to see how the DOM moves without immediate access to the Application Under Test.

You should look at the DOM of your web page using Browsers’ DevTool.