Unable to find webelement using id or name or classname or xpath


I have the following as my HTML tags.

<div><a href=”https://xxxxxx.com/index.jsp” target=”_blank”>
<div class=”app img-circle” style=”background-color:#00A3AD;” id=”PHUB-0101″><div class=”tile-img”>
<img src=”https://c.ap1.content.force.com/servlet/servlet.ImageServer?id=01590000009cI9r&amp;oid=00D90000000iGNH”></div>
<div title=”SOS PPT (SSO)” class=”applabel”>
<span>SOS PPT (SSO)</span></div></div></a></div>

If i inspect the element, i get following as my xpath

I have tried to find this web element by using multiple forms however it doesnt seem to be working. Could you please help?
driver.findElement(By.className(“applabel”)).click(); –> this works but it is taking me to a different webelement which has the same classname

driver.findElement(By.id(“PHUB-0101”)).click(); –> does not work


Default Asked on December 30, 2015 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    just would like to clarify that above code snippet is part of a container xpath for which is //*[@id=”appcontainer”]

    I guess my question is how do i find an element within a container? Or is there a way to list out the container items and then select it?

    Default Answered on December 30, 2015.
    Add Comment

    Check if the element is in any frame. if it has any Frame in complete tag.  then you need to switchto that particular frame to work with element

    Train Answered on December 31, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.