如何在Selenium IDE中将属性从子元素存储到变量

时间:2015-10-14 14:06:31

标签: selenium xpath ide attributes

我需要storeAttribute" // images.wbstatic.net/promotions/wide/51597.jpg"由孩子变量" span class =" countdown-hours "" 有人可以帮忙吗?

<img alt="Autumn Sale" src="//images.wbstatic.net/promotions/wide/51597.jpg">
<div class="countdown-container" data-end-time="\/Date(1444856400000+0300)\/" data-start-time="\/Date(1444805633216+0300)\/">
to the end is
<div class="countdown-timer">
    <span class="countdown-days">
        <span class="dots">:</span>
        <span class="countdown-hours">
            07
        <span>hours</span>
    </span>

1 个答案:

答案 0 :(得分:0)

您可以使用以下XPath获取uipopovercontroller标记。

img

xpath会找到//div[@class='countdown-container'][.//span[@class = 'countdown-hours']]//preceding-sibling::img 标记旁边的div标记,其中包含imgspan,然后返回count-hours标记。