a return value with @Test

Answered

I’m using the following to see if an element is present. When I call it I get the following msg:

Method public static boolean AutomationFramework.SalesForce.isElementPresent(org.openqa.selenium.WebDriver,org.openqa.selenium.By) has a @Test annotation but also a return value: ignoring it. Use <suite allow-return-values=”true”> to fix this

When I call this method. I’m not sure what  I do for this fix “Use <suite allow-return-values=”true”> to fix this” . Where is that set?


public
static boolean isElementPresent(WebDriver driver, By by) {

try {

driver.findElement(by);

return true;

}

catch(NoSuchElementException e){

return false; }

}

 

Add Comment
  • 2 Answer(s)
    Best answer

    So it looks like I need to update an XML file. Can you point me to where this might be?

    Train Answered on October 20, 2015.

    This would be your Test NG Suite Xml , Please update the Same accordingly.

    Same time please add a comment for the answer rather than replying as a separate answer

    on October 21, 2015.

    Will do, thanks again …

    on October 22, 2015.
    Add Comment

    Please follow the suite Standards as mentioned below , Hope this would work

     

    Supporter Answered on October 20, 2015.
    Add Comment
  • Your Answer

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