首页 > 解决方案 > How to find element by xpath in shadow dom

问题描述

enter image description here

I have tried the below code for element "Loading History". But not working. Please help to solve by Xpath

  seleniumlib = BuiltIn().get_library_instance('SeleniumLibrary')
  driver = seleniumlib.driver
  root1 = driver.find_element_by_tag_name('sn-component-va-web-client')
  shadow_root1 = expand_shadow_element(driver,root1)
  shadow_root1.find_element_by_xpath("//div[text()='Loading History']")

标签: seleniumselenium-webdriverselenium-chromedrivershadowshadow-dom

解决方案


推荐阅读