7

I want to get (and store to variable) url of one hyperlink (link) on the web page. Is it possible to get it in the Selenium IDE?

In my test I have to verify, if link exists, then store url from this link and use it later in the test.

Thanks.

3 Answers 3

11

Although this question was originally asked for the IDE, I just came here through Google searching for the same answer for Python.

The one above gives

AttributeError: 'WebElement' object has no attribute 'getAttribute'

because for Python it is

driver.find_element(By.xxx).get_attribute('href')
Sign up to request clarification or add additional context in comments.

Comments

10
driver.findElement(By.xxx).getAttribute('href');

Comments

1

Yes, you can simply use storeAttribute.

I could be more explicit if you'd say whether you're using Selenese or some other language.

1 Comment

I am laughing. My answer got downvoted into the negative for being the only one relevant to the Selenium IDE. It is possible you have not heard of it. The original poster specifically asked in relation to the Selenium IDE, a plug-in that actually works in the version of Firefox that was current back then. (It still works in the Pale Moon browser.) You can see that the OP thanked me.

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.