if(!"".equals(MyFrnds.list_Friends))
{
System.out.println("There is friends list");
Actions action= new Actions(driver);
action.contextClick(MyFrnds.list_Friends).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();
System.out.println("My first friend link is opened in new tab and clicking on Show more button if there are more than 12 friends ");
if(!"".equals(MyFrnds.list_Friends))
{
MyFrnds.btn_FrShowmore.click();
}else
{
System.out.println("There are no more than 12 records");
}
}
else
{
System.out.println("There are no friends to display. So clicking on these two links to add friends");
// Right on FITBASE MEMBERS link and open in new tab
Actions action= new Actions(driver);
action.contextClick(MyFrnds.lnk_Fitbasemem).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();
// Right on Social network link and open in new tab
action.contextClick(MyFrnds.lnk_Socialnet).sendKeys(Keys.ARROW_DOWN).sendKeys(Keys.RETURN).build().perform();
}
In the above code on very first line I gave If condition as (!"".equals(MyFrnds.list_Friends)) but irrespective of the application it goes to first part of the condition even though it doesn't satisfy the first condition. Hence we get error in executing the script. Can anyone suggest what is wrong in the code.