0
我導出Selenium IDE代碼以便在Selenium Web驅動程序中進行自動化測試。該代碼正確執行,但在單選按鈕上停止並在Selenium Webdriver上產生錯誤。請指導我在webdriver上成功執行單選按鈕。Selenium Webdriver單選按鈕問題
我的代碼是:發現
driver.FindElement(By.Id("ContentPlaceHolder1_ucTriple_rptOffers_AddToCartButton_0")).Click();
System.Threading.Thread.Sleep(20000);
driver.FindElement(By.Id("rptShoppingServiceGroup_dlAddons_1_ctl03_0_1_0")).Click();
driver.FindElement(By.Id("rptShoppingServiceGroup_dlAddons_1_ctl03_1_3_1")).Click();
driver.FindElement(By.Id("rptShoppingServiceGroup_dlDevices_1_ctl03_0_1_0")).Click();
driver.FindElement(By.Id("rptShoppingServiceGroup_dlAddons_2_ctl01_2")).Click();
driver.FindElement(By.Id("rptShoppingServiceGroup_dlDevices_2_ctl03_0_2_0")).Click();
driver.FindElement(By.Id("rptShoppingServiceGroup_dlDevices_2_ctl03_0_0_0")).Click();
driver.FindElement(By.Id("SubmitButton")).Click();
錯誤是:
Unable to locate element: {"method":"id","selector":"rptShoppingServiceGroup_dlAddons_1_ctl03_0_1_0"}
如何從中刪除錯誤,併成功地執行它。
單選按鈕是否存在於一個框架內?在導出的腳本中,是否可以看到任何註釋掉的框架語句? – Hemanth