Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropDown.SelectElementByText does not trigger change event #220

Open
brunoshine opened this issue Oct 20, 2015 · 1 comment
Open

DropDown.SelectElementByText does not trigger change event #220

brunoshine opened this issue Oct 20, 2015 · 1 comment
Labels

Comments

@brunoshine
Copy link

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

@robdmoore
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants