Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98939

Css or Xpath selector can't select a list element

$
0
0

I am trying to automate a process on a website that dynamically generates IDs for its elements :

Ids have this form: ZCODE:FORM:j_1279323:element

I managed to make CSS or XPATH selectors for most of the elements. I am struggling though with a ul/li element which I manage to click on with its id but not with a relative XPath, which is what I aim to achieve:

I have tried all sorts of xpath: /html[1]/body/[1]/div[37]/div[1]/ul[1]/li[13]

also: //div[contains(@id, 'voie_panel')]/div/ul/li[13]

And many other different ways.. All the xpath/css selector I tested work perfectly in chrome developer console.

I only manage to drop the list down, but when I am trying to access the list element... it times-out.

I am using WebDriverWait, I have also tried to Pause the program at the exact point where it has to be loaded in order to click on the list.

I wait for the element with:

myElem = WebDriverWait(self.driver, 30).until(ec.element_to_be_clickable((BY.XPATH, css))

To summarize the situation : It works smoothly with the ID but times out with an xpath or css selector

Can someone recommend a strategy to overcome this ?


Viewing all articles
Browse latest Browse all 98939

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>