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

Select dropdown (drop-down) options - use the option value to denote what to select #305

Closed
stevzie opened this issue Nov 5, 2018 · 3 comments
Labels

Comments

@stevzie
Copy link

stevzie commented Nov 5, 2018

Placing this here so it does not confuse other users ...

When using the "select" instruction -- select dropdown_name as option
you must use the value attribute (not the user visible text).

For example (from Wordpress):

	<option value="wpseo_editor">SEO Editor</option>
	<option value="wpseo_manager">SEO Manager</option>
	<option value="bbp_participant">Participant</option>
	<option value="bbp_moderator">Moderator</option>
	<option value="administrator">Administrator</option>
        <option value="">— No role for this site —</option>
</select>`

the correct statement to select the "SEO Manager" option is:

select role as wpseo_editor
@kensoh kensoh changed the title Select dropdown (drop-down) options Select dropdown (drop-down) options - use the option value to denote what to select Nov 6, 2018
@kensoh kensoh added the query label Nov 6, 2018
@kensoh
Copy link
Member

kensoh commented Nov 6, 2018

Nice, thanks @stevzie ! It's mentioned in the cheat sheet but this is going to be helpful to other users.

Copying @Aussiroth who is now maintaining TagUI for AI Singapore -

@shahidshaikhlk
Copy link

@stevzie I am trying to select value from drop down which is having
name="MC19x279_select_attribute" and drop down value is "creationtime".
I am doing like this click //select[@name="MC19x279_select_attribute"] as option creationtime .
But getting error. Could you please help me to get the correct way.

@kensoh
Copy link
Member

kensoh commented Oct 18, 2019

Oh @shahidshaikhleaque the syntax is

select //*[@name="MC19x279_select_attribute"] as creationtime
  1. the step to use is select, not click
  2. for xpath using * instead of select will work
  3. no need for option keyword before creationtime

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

4 participants