I am trying to call method from one custom keywords to another Custom keywords functions

But i am getting below error,

05-30-2018 02:59:02 PM - [START] - Start action : mandatoryfield_Validation.Mandatoryfieldvalidation.textfieldvalidation 05-30-2018 02:59:02 PM - [INFO] - Finding Test Object with id 'Object Repository/HelpDeskModule/Master/Team/Page_eFACiLiTY/input_Txt_Code' 05-30-2018 02:59:02 PM - [ERROR] - No such property: CustomKeywords for class: mandatoryfield_Validation.Mandatoryfieldvalidation 05-30-2018 02:59:02 PM - [END] - End action : mandatoryfield_Validation.Mandatoryfieldvalidation.textfieldvalidation 05-30-2018 02:59:02 PM - [ERROR] - Test Cases/HelpDeskModule/Master/Team_/Team FAILED because (of) Variable 'CustomKeywords' is not defined for test case.

public class Mandatoryfieldvalidation {
//<!--Initializing object-->

private static Connection connection = null;
private static  String columntype;
private static int num;
private static int datatypevalue
def driver = DF.getWebDriver()
KeywordLogger logger = new KeywordLogger()
JavascriptExecutor js = ((driver) as JavascriptExecutor)
//Method for validating textfield
@Keyword
def void textfieldvalidation()
{
CustomKeywords.'alerthandling.verifyalertpresent.verifyalert'()

}
}

It is possible, but you need to import corresponding packages. By the looks of it, you should try this:

import alerthandling.verifyalertpresent

instead of CustomKeywords.'alerthandling.verifyalertpresent.verifyalert'()

use (new alerthandling.verifyalertpresent()).verifyalert()

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.