I need to pass the newly created company name to a method and verify whether it is added to the left pane list or not.

I have written a code but it is not working. Help me plz . I’m new to selenium

By dropDownShowEntryValue = By.xpath("//div[@id='sidebar-menu']/div/ul/li[@class='nv active']/ul/li");

public boolean verifyValueEngagement(String getvalue) {

List<String> dropDownTexts = new ArrayList<>();

List<WebElement> showDropdownList = driver.findElements(dropDownShowEntryValue);

for (int i = 0; i<showDropdownList.size(); i++) {


if (getvalue.equals(dropDownTexts)) {


System.out.println("Engagement is in the list " + dropDownTexts);

} else {

System.out.println("Engagement is not in the list");




return false; }

Default Asked on November 25, 2016 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

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