Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I count xpath using 2 elements?
    text
    copied!<p>I want to count the number of stars if an entry is successfully submitted. There can also be stars for entries that aren't submitted yet. If the entries aren't submitted yet, I want to ignore those entries even though there are stars for those entries that aren't submitted yet.</p> <p>This is the code I want to count:</p> <pre><code>&lt;table&gt; &lt;tr id="entry_row_25494"&gt; &lt;td&gt; &lt;img id="star_span_25494" img="" &lt;="" src="/images/yes_star.png" onclick="toggleStar(25494);"&gt; &lt;/td&gt; &lt;td&gt; &lt;img title="Entry successfully submitted" alt="Entry successfully submitted" src="/images/greencirclecheck.png"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id="entry_row_25496"&gt; &lt;td&gt; &lt;img id="star_span_25496" img="" &lt;="" src="/images/yes_star.png" onclick="toggleStar(25496);"&gt; &lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>This is what I have:</p> <pre><code>$numOfStars = $this-&gt;getXpathCount("xpath=(//img[contains(@src, 'yes_star') and (contains(@src, 'greencirclecheck.png'))])") </code></pre> <p>These are what I've tried so far in Selenium IDE using storeXpathCount</p> <pre><code>//table//img[@src='/images/yes_star.png' and @src='/images/greencirclecheck.png'] //table/tbody/tr[*]/td[*]/img[contains(@src, 'yes_star.png')]/parent::*[contains(@src, 'greencirclecheck.png')] //img[contains(@src, 'greencirclecheck.png')]/preceding::img[contains(@src, 'yes_star.png')] xpath=(//img[contains(@src, 'yes_star.png')]//img[contains(@src, 'greencirclecheck.png')]) </code></pre> <p>But those doesn't work</p> <p>Let me know if you need me to clarify instead of downvoting. I'm new to Selenium and PHPUnit, so the question might not be clear.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload