Jump to content

cucumber with gherkins


Recommended Posts

Posted
8 minutes ago, Dimpy123 said:

@3$%

Spellings nerchuko fafa gherkins kaadu adi

Posted
2 minutes ago, samaja_varagamana said:

Spellings nerchuko fafa gherkins kaadu adi

oh really....

Posted
32 minutes ago, Dimpy123 said:

step defenation enduku use chestam, reusability ela  chestam...

That's what BDD is all about..You write a functional test case in the form of Gherkin stories..It's mainly used for automation testing..

Reusability ante parameters use chestharu..where you have the same step class for all the gherkin stories 

Posted
23 minutes ago, ronitreddy said:

That's what BDD is all about..You write a functional test case in the form of Gherkin stories..It's mainly used for automation testing..

Reusability ante parameters use chestharu..where you have the same step class for all the gherkin stories 

for example login page undi, same script with different test data pass chestam kada, alantivi ela chestam

Posted
1 hour ago, Dimpy123 said:

use chese vallu itu randi....

Cucumber with salt telusu what is Cucumber with Gajji.

Calling Bagaru please help Dimpy sister of swathi naidu

Posted

Assuming that you know Java, I am giving you a code snippet for the Login Page & Login Steps

public class LoginPage 

@Autowired

Environment environment

private static final By LOGIN_USERNAME_INPUT = By.id("eusermanagement_login_logi_USER_ALIAS_id_input");

private static final By LOGIN_PASSWORD_INPUT = By.id("eusermanagement_login_logi_PASSWORD_id_input");

private static final By LOGIN_BUTTON = By.id("eusermanagement_login_logi_signin_id");

private static final By LOGIN_LINK = By.id("eusermanagement_logout_logo_logout_id");

private static final By LOGIN_DIALOG_OK = By.id("uicAlertBox_ok");

public void Login() throws Exception

driver.get(environment.getProperty("url");

Thread.sleep(5000);

driver.findElement(LOGIN_USERNAME_INPUT).sendKeys(environment.getProperty("username"));

driver.findElement(LOGIN_PASSWORD_INPUT).sendKeys(environment.getProperty("password"));

driver.findElement(LOGIN_BUTTON).click();

}

public void Logout() throws IOException, InterruptedException{

Thread.sleep(5000);

driver.findElement(LOGOUT_LINK).click();

driver.findElement(LOGOUT)DIALOG_OK).click();

}

}

Posted

public class LoginSteps{

@Autowired

LoginPage loginpage;

@When("I login to X URL")

public void login() throws IOException {

loginPage.Login();

}

@When("I logout from X Website")

public void logout() throws IOException {

loginPage.Logout();

}

}

 

Posted
Gherkin Story
Scenario: Logging into X Website
When I login to X URL
When I logout from X Website

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...