0

We have a Website with Vaadin technologie.

Test environment:
firefox-56.0.1 
geckodriver: 0.20.0 
Robotframework 4.1.1
selenium       3.141.0 
Python 3.7.3 

This Python script are working, robot can click on this locator.

GetElement.py

    def Get_Element_hmenu():
        Lib = BuiltIn().get_library_instance('SeleniumLibrary')
        Driver = Lib.driver
        host1 = Driver.find_element_by_xpath("//vaadin-context-menu-item[@id='FILE_MENU']")
        return host1

test.robot<br>
<br>

       ${Element}=  Get_Element_hmenu
       Log  ${Element}
       Click Element   ${Element}

If I update this components

Firefox 92.0.1
Geckodriver  0.30.0

After update doesn't work this code.

NoSuchElementException: Message: Unable to locate element: //vaadin-context-menu-item[@id='FILE_MENU']

Do you have any idea, what should I do ? Many Thanks

HTML Code enter image description here

Simi
  • 11
  • 3

1 Answers1

2

Shadow DOM support was added in Firefox 63. In your previous setup with Firefox 56 the shadydom polyfill was used and as there was no shadow root encapsulation and that made the vaadin-context-menu-item findable in the element query.

After updating Firefox version there are shadow roots and you need to search inside them. Looking at the dom tree in your screenshot you'd need to select the shadow root inside the vaadin-menu-bar, and search for the vaadin-context-menu-item in that context. This answer has some examples of how to do it.

Guille
  • 449
  • 3
  • 6