Question

Okey, So i am trying to run a selenium test case using PHPUnit. I did a lot of little test using or checkbox etc.. but i have a problem that i thought easy..

I just want to go to the other page using the function byLinkText("Text of link") So, at first sight it's not hard but it's doesn't work and i don't know why..

This is my html :

<div id="menu-haut">
    <ul class="ul0">
        <li class="li0"><a href="/order" class="lien0">Commander</a></li>
        <li class="li0"><a href="/gerer" class="lien0">Gérer</a></li>
        <li class="li0"><a href="#" class="lien0 inactive">Analyser</a></li>
        <li class="li0"><a href="#" class="lien0 inactive">Services</a></li>
        <li class="li0 active0"><a href="/support" class="lien0active">Support</a></li>
    </ul>
</div>

So,i just want to click on the 'Support' link. Logically i will do with Selenium 2 :

$this->byLinkText('Support')->click();

but it's doesn't work and i have this error :

1) BoitierTest::testLink
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: Unable to locate element: {"method":"link text","selector":"Support"}

if someone can explian me this sh.. ^^ I would be grateful

Was it helpful?

Solution

I resolved my problem. In fact, , as i resumed the code, and there was an css attribute which makes everything not working.

The attribute was : text-transform : uppercase;

and despite this , in the source code, it's was write 'Support' and in my interface 'SUPPORT' so i removed it , and it's works well now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top