Skip to content

DropDown.SelectElementByText does not trigger change event #220

Open

Description

@brunoshine

Hi,

when using the DropDown.SelectElementByText the change event on the client-side is not triggered. A simple change to the TestStack.Seleno/PageObjects/Controls/DropDown.cs method change can fix this:

From:
var scriptToExecute = string.Format("$('#{0} option:contains(\"{1}\")').attr('selected',true)", Id, optionText.ToJavaScriptString());

To:
var scriptToExecute = string.Format("$('#{0} option:contains(\"{1}\")').attr('selected',true).change()", Id, optionText.ToJavaScriptString());

Cheers,
Bruno

Activity

  1. robdmoore commented on Nov 8, 2015

    @robdmoore
    Member

    There are other events that don't get triggered too, but I agree that change is the most important and this has annoyed me in the past.

    You can overcome it by dropping down to Selenium Web Driver, but that code's not as nice of course.

    I'm happy for you or someone else to submit a pull request to add the change() call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions