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

for select the css selector doesnt work . #331

Closed
SreenijaK opened this issue Jan 4, 2019 · 1 comment
Closed

for select the css selector doesnt work . #331

SreenijaK opened this issue Jan 4, 2019 · 1 comment
Labels

Comments

@SreenijaK
Copy link

I'm trying to enter value to dropdown by the following command.

click (//SELECT[@Class="form-control ng-pristine ng-untouched ng-valid"])[2]
select (//SELECT[@Class="form-control ng-pristine ng-untouched ng-valid"])[2] as 1

The above is failing to identify the dropdown.
PS:I don't want to use other ways of selection like xpath, etc.

@Aussiroth
Copy link
Contributor

Hi, for this if you use chrome you can try right clicking on the select element you want, and right clicking it -> copy selector for css selector to make sure the selector is correct, or copy xpath for xpath selector.
While you mention you want to use a css selector instead of xpath, the selector you provided in the example here is an xpath selector. It should look similar to the screenshot here.
image

For doing the select, you need to provide the second argument (after the 'as') to be the value of the option you want selected. For an example of how it should be, check the issue here #305

I hope these help you!

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

3 participants