Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97863

Click on a child div according to main title

$
0
0

I have a div and within it several debts. In each div, I have a title, results and a final div to click on. How do I make the click event in this final div according to a title search?

I have experience with WebDriver and PHP, but I've tried it all with the function By.xpath but no success.

Example: I need to click in <div class="Link_Text "></div> if it has the text "Race 19 Magic" in the <div classe="RaceTitle "></div>

How to?

$driver->findElement(By.xpath(" XPATH_HERE "))->click();

<div>
    <div class="races ">
        <div class="FixedRace ">
            <div class="RaceTitle ">Race 19 Magic</div>
            <div class="Link ">
                <div class="Link_Text ">See All</div>
            </div>
        </div>
        <div class="FixedRace ">
            <div class="RaceTitle ">8.57 Mega (Race 10)</div>
            <div class="Link ">
                <div class="Link_Text ">See All</div>
            </div>
        </div>
    </div>
</div>

Viewing all articles
Browse latest Browse all 97863

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>