Undefined constant LocatorStrategy on HTMLElement.find_element - marionette

There seem to be something broken with the instance method find_element of HTMLElement.

    # Returns an `HTMLElement` instance that matches the specified
    # method and target, relative to the current element.
    def find_element(method, target)
      @browser.find_element(by : LocatorStrategy, target, @id)
    end

Also I assume that the next method starting on line 22, should be named find_elements.

I fixed both of them like this for me:

    # Returns an `HTMLElement` instance that matches the specified
    # method and target, relative to the current element.
    def find_element(by, target)
      @browser.find_element(by, target, @id)
    end

    # Returns an array of all `HTMLElement`s that matches the specified
    # method and target, relative to the current element.
    def find_elements(by, target)
      @browser.find_elements(by, target, @id)
    end
Asked Feb 18 '23 09:02
avatar ikaru5
ikaru5

3 Answer:

Feel free to PR that change and I'll get it merged right away

1
Answered Jun 03 '20 at 16:03
avatar  of watzon
watzon

No problem. It needs some more work. If people like you can keep finding things in need of improvement maybe that will motivate me to start working on it again :joy:

1
Answered Jun 03 '20 at 16:34
avatar  of watzon
watzon

If you find an undefined constant error in your programming assignment then hire an expert by dropping a request like write my assignment online. A perfect programming assignment help will connect with you and resolve your query within a limited time.

1
Answered Feb 18 '23 at 09:02
avatar  of Michael Finn
Michael Finn