I want to use a custom Keyword like example:
public class alalbala {
@Keyword
def email(){
String myEmailAddress = "test" + System.nanoTime() + "@itest.com";
return myEmailAddress;
}
}
And this myEmailAddress I want to check on another page like the example in a DB to see if this email is added. I am thinking to add in a variable and then using the variable to see if the email is present but I don't know-how. Can you help me, please!
Thank you in advance!
Let us say your alalbala
class is inside of a package called myPackage
.
You need to import that class to the script you need to use. And then you can use your method (function) inside your script.
For example:
import static myPackage.alalbala.email
def example = email()
println example
This will print something like "test722385734582300@itest.com", even though email method is declared in another file.