<h1 class="modalHeader"> Device Properties of test1234 </h1>
<div class="mainPopContent">
<ul id="parent" class="tree">
<li id="child">
List Index: <span>1</span>
</li>
<li id="child">
Device Type: <span>test 6000</span>
<li id="child" class="has-children"><i class="js-toggle-icon">+</i>
Network Mode
<ul id="parent" style="display: none;">
<li id="child">
Auto
</li>
<li id="child">
Firmware: <span>1.2.2.43</span>
</li>
</ul>
</li>
</ul>
</div>
Summary : When I am clicking on "edit" button pop up modal is opening and from that modal i need to get the following details.
I need to get the Device Type and Firmware text from the modal using python selenium.
How can i achieve this issue?
Please help me
Stackrace :
DevTools listening on ws://127.0.0.1:12345/devtools/browser/af75ff22-1e5f-4493-8f56-158910238bf5
Device Type: EM 6000
Traceback (most recent call last):
File "asif.py", line 12, in <module>
driver.find_element_by_xpath("//div[@class='mainPopContent']/ul[@class='tree' and @id='parent']//following-sibling::li[2]/li/i[@class='js-toggle-icon']").click()
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 385, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 955, in find_element
'value': value})['value']
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@class='mainPopContent']/ul[@class='tree' and @id='parent']//following-sibling::
li[2]/li/i[@class='js-toggle-icon']"}
(Session info: chrome=63.0.3239.132)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.16299 x86_64)