Forums - C# Corner

Forum guidelines
Madiha Safdar

Madiha Safdar

  • 1.8k
  • 2
  • 160

Unable to click on submenu via selenium c# urgent

Apr 18 2019 11:28 PM
i am new to automation testing and need some help. i want to click on child submenu but unable to do so. hirerachy of my menu is System->Manual->Manual Loader, how ever i am only successful in hovering main menu i.e. System. i am following the code given below. kindly help what to do
Note: Action builder is not working in my case or i am doing something wrong thats why it doesnt give the required output.
  1. Actions builder = new Actions(driver);  
  2. // Move the cursor to the Main Menu Element (id1)  
  3. IWebElement menu = driver.FindElement(By.XPath("//*[@id='dvmenus']"));  
  4. builder.MoveToElement(menu);  
  5. IWebElement menuId = driver.FindElement(By.XPath("//a[contains(.,'System')]"));  
  6. //menuId.Click();  
  7. builder.MoveToElement(menuId);  
  8. WebDriverWait waitForControl = new WebDriverWait(driver, TimeSpan.FromSeconds(10));  
  9. IWebElement submenuId = driver.FindElement(By.XPath("//a[contains(.,'Manual')]"));  
  10. builder.MoveToElement(submenuId);  
  11. //submenuId.Click();  
  12. WebDriverWait waitForControl1 = new WebDriverWait(driver, TimeSpan.FromSeconds(10));  
  13. IWebElement childsubmenuId = driver.FindElement(By.XPath("//a[contains(.,'Manual Loader')]"));  
  14. builder.MoveToElement(childsubmenuId);  
  15. builder.Build().Perform();  
i am getting this error on "'element not interactable"