如何从Selenium IDE中的'link'元素获取url [英] How to get url from 'link' element in Selenium IDE

查看:612
本文介绍了如何从Selenium IDE中的'link'元素获取url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在网页上获取(并存储到变量)一个超链接(链接)的URL。是否可以在Selenium IDE中获取它?

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?

在我的测试中,我必须验证,如果链接存在,则存储来自此链接的URL并稍后在测试。

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

谢谢。

推荐答案

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

这篇关于如何从Selenium IDE中的'link'元素获取url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆