1

I'm trying to automate some web testing using Kantu and Selenium. The page is using pq-select ParamQuery to generate select menus, but neither Kantu or Selenium can see them in the page.

I'm guessing my best bet is to use xpath to locate them, but I'm not too sure on how to do that. The HTML for the select menu is:

<td style="white-space: nowrap " aria-describedby="df230254-d8a5-4ba1-9950-58d26145d5a9" role="gridcell" data-container-for="section1" id="sectiongrid_active_cell" class="">

If I could use the data-container-for that would be the best I think, but I'm not sure how to get that via xpath.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Tony
  • 3,587
  • 8
  • 44
  • 77
  • The above html is not PQ select.Please update sibilings of the td element – Navarasu Oct 27 '18 at 12:16
  • If an XPath locator does not work or is tricky, maybe you can check on the the _image_ (screenshot) of the menu insteadwith [visualAssert](https://a9t9.com/kantu/docs/visual-ui-testing) instead? – Fabrice Zaks Oct 31 '18 at 23:47

1 Answers1

0

As per the HTML you have shared you can use either of the following solutions:

  • XPath - 1:

    //td[@id='sectiongrid_active_cell' and @data-container-for='section1']
    
  • XPath - 2:

    //td[@id='sectiongrid_active_cell' and @data-container-for='section1'][@role='gridcell']
    

Note: The element is a ParamQuery select element which is being converted to theme ready jQueryUI widget, you have to induce WebDriverWait for the element to be visible/interactable.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thank you for that, unfortunately, Kantu just states times out when 'waitForVisible' using both the xpath's you provided. I've tried multiple different automation applications, all of them fail when trying to find these dynamic elements. – Tony Oct 27 '18 at 11:59
  • @Tony Can you update the question with your code trials? – undetected Selenium Oct 27 '18 at 12:02
  • Well my tests are all written in Kantu, so it's just open the page and find that element, simple as that. – Tony Oct 27 '18 at 12:14