From bf5a59e55417da229df99eed5962930f33eedde3 Mon Sep 17 00:00:00 2001 From: luxuyang Date: Fri, 23 Aug 2024 18:25:30 +0800 Subject: [PATCH] *[misc] Fix bug that picker doesn't work. --- test/lib/webdriver/webdriver.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/lib/webdriver/webdriver.class.php b/test/lib/webdriver/webdriver.class.php index 59a85494c4..6e5bb3bf97 100644 --- a/test/lib/webdriver/webdriver.class.php +++ b/test/lib/webdriver/webdriver.class.php @@ -999,8 +999,14 @@ class dom if($xpath != 'form') { - $this->driver->findElement(WebDriverBy::xpath("//a[@title='$value']"))->click(); - $this->driver->findElement(WebDriverBy::xpath("//*[@id='pick-pop-$pickerID']//span[@class='is-match-keys']"))->click(); + try + { + $this->driver->findElement(WebDriverBy::xpath("//a[@title='$value']"))->click(); + } + catch(Exception $xpathException) + { + $this->driver->findElement(WebDriverBy::xpath("//*[@id='pick-pop-$pickerID']//span[@class='is-match-keys']"))->click(); + } } else {