Hello,
I have query in creating parameterized stories. In my steps class I have a step
@When("user types \"$text\" in \"$objectId\"")
public void userTypesData(String text, String objectId){
seleniumLayer.textType(text,objectId);
}
I am using this step for every textbox data filling. E.g. my login story looks
like -
When user types "[email protected]" in "username"
When user types "pass1234" in "password"
When user clicks button "Login"
Now I want to make this login story as parameterized so that different stories
can call login story with different credentials (usename and password).
To achieve this I have modified my login story as below -
When user types <text1> in "username"
When user types <text2> in "password"
When user clicks button "Login"
But to execute this I need to modify my java class too as below -
@When("user types \"$text\" in \"$objectId\"")
@Alias("user types <text1> in \"$objectId\"")
public void userTypesData(@Named("text1") String text, String objectId){
seleniumLayer.textType(text,objectId);
}
As per my understanding I need to write another method to handle the <text2>
parameter. My query is there any way to use the same method again and again for
different parameters (e.g. for text1 and text2). This is going to be a bigger
issue if I am having 10-15 input boxes on my site and for all of them I want to
pass parameters.
Any help or any suggestions on this?
Thanks in Advance
Arpit
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the
property of Persistent Systems Ltd. It is intended only for the use of the
individual or entity to which it is addressed. If you are not the intended
recipient, you are not authorized to read, retain, copy, print, distribute or
use this message. If you have received this communication in error, please
notify the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.