Лучше использовать явные ожидания вместо неявных ожиданий.Явные ожидания ждут вашего заданного условия, и когда условие выполнено, оно перестает ждать.
Поскольку вы ожидаете, что что-то будет присутствовать после щелчка, дождитесь, пока этот элемент станет видимым, используя явное ожидание.
Попробуйте это:
// declare a wait first and you could reuse it
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement button = driver.findElement(By.xpath("//span[contains(text(), 'Click Me')]"));
// instead of implicit wait this waits for the button to be clicable and doesn't wait more than necessary
wait.until(ExpectedConditions.elementToBeClickable(button));
button.click();
WebElement expected_element = driver.findElement(By.id("pqr"));
//this waits for your expected element to be visible after click. if the element is not visible after 30 seconds it will throw timeout exception
wait.until(ExpectedConditions.visibilityOf(expected_element));