OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

dropdown with enabled and disabled elements [closed]

  • Thread starter Thread starter ATUL KADAM
  • Start date Start date
A

ATUL KADAM

Guest
I have drop down containing combination of enabled and disabled elements, need to select multiple elements using check boxes which are enabled, using for loop. Please suggest suggestions in Selenium Python.

I tried is enabled(), first element on list is disabled, showing element click intercepted exception. If element in list in disabled move to next element and click which is enabled

This is the code I'm trying:

Code:
for i in range(1, 4):
        if driver.find_element(By.XPATH,"/html/body/p-multiselectitem["+str(i)+"]/li").is_enabled():
           driver.find_element(By.XPATH,"/html/body/p-multiselectitem["+str(i)+"]/li/").click()
   i = i + 1
<p>I have drop down containing combination of enabled and disabled elements, need to select multiple elements using check boxes which are enabled, using for loop. Please suggest suggestions in Selenium Python.</p>
<p>I tried is enabled(), first element on list is disabled, showing element click intercepted exception. If element in list in disabled move to next element and click which is enabled</p>
<p>This is the code I'm trying:</p>
<pre><code>for i in range(1, 4):
if driver.find_element(By.XPATH,"/html/body/p-multiselectitem["+str(i)+"]/li").is_enabled():
driver.find_element(By.XPATH,"/html/body/p-multiselectitem["+str(i)+"]/li/").click()
i = i + 1
</code></pre>
 

Latest posts

N
Replies
0
Views
1
Nazar Bilyi
N
Top