Unable to Locate webelement | Selenium Forum
M
Posted on 29/09/2015
I want to locate the "Partner Information" from below firepath code, can u please help me find the same I have tried xpath,TagName
nothing is working out

below is the code I have written can please tell me what is wrong here
java.util.List<WebElement> elelist = dr.findElements(By.tagName("map"));

for(int i =0; i<elelist.size() ;i++)
{
if(elelist.get(i).getAttribute("href").contains("Partner"))
{
elelist.get(i).click();
break;
}


}

<map name="topMenu">
<area alt="Home" href="/pricingtool/Home.do" coords="71,2,87,28,3,28,17,2" shape="poly">
<area alt="Partner Information" href="/pricingtool/Partner.do" coords="214,2,230,29,90,29,106,2,215,3" shape="poly">
<area alt="Services" href="/pricingtool/Service.do?creationMode=true" coords="309,2,328,29,233,29,248,2" shape="poly">
<area alt="Revenue Share" href="/pricingtool/ListRevenueShareService.do" coords="347,1,332,27,446,27,429,2" shape="poly">
<area alt="Packages" href="/pricingtool/ChoosePackage.do" coords="452,27,552,27,535,3,466,2" shape="poly">
<area alt="Pricing" href="#" coords="634,28,619,3,572,2,558,28" shape="poly">
<area alt="Summary" href="#" coords="727,28,711,2,654,3,640,28" shape="poly">
</map>

M
Replied on 29/09/2015

try this xpath

//*[@alt='Partner Information']