2013-06-28 83 views
1

我已經寫了一個腳本datepicker從日曆中選擇日期。這些腳本在本地運行良好,但是當我通過jenkins運行腳本時,腳本失敗了。Selenium webdriver點擊()失敗jenkins

action.moveToElement(driver.findElement(By.xpath("//*[@id='ui-datepicker-div']/div[1]/div/a/span")));//locating the element to click 
     action.perform(); 
action.click(driver.findElement(By.xpath("//*[@id='ui-datepicker-div']/div[1]/div/a/span"))); //this line is not executing 
     action.perform(); 

單擊該元素的腳本不起作用。我越來越error as "Element is not currently visible and so may not be interacted with"

我也試過驅動程序。 findElement(By.xpath("//*[@id='ui-datepicker-div']/div[1]/div/a/span")).click() by replacing action.click()但仍然沒有用。

+0

你有沒有找到解決這個問題的辦法?同樣的事情發生在我身上。 – jlars62

回答

0

你不能用selenium點擊隱藏的元素,因爲如果拋出你看到的異常。您應該讓元素可見(以用戶的方式)或使用javascript來點擊(請參閱JavaScript執行程序)。

相關問題