How do you locate and handle dynamic web elements or tables using dynamic XPath in Selenium WebDriver?