0

I'm having an issue with Robot.

I run this method within a python script and everything is ok.

go_button = self.driver.find_elements_by_css_selector(".xxx")[0]

Basically I need to grab the first element that matches this selector and I can do this no problem via python directly.

However, I cannnot do the same via Robot. I have something like this:

Click Button    css=.xxx

I guess my question is, how can I index results if a locator returns more than 1 result

1 Answer 1

1

How about using XPATH locator as below to select the 1st element?

xpath=//*[@class='xxx'][1]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.