{{theTime}}

Search This Blog

Total Pageviews

Cucumber Eclipse sample program

Cucumber Eclipse SetupCreate Eclipse Maven Project
  • Open pom.xml
  • Goto Dependencies
  • Add GroupId: info.cukes, Artifact Id: cucumber-java, Version: 1.2.5
  • Add GroupId: info.cukes, Artifact Id: cucumber-junit, Version: 1.2.5Create Features Folder and add StepDefinitions.feature file
Create a Feature File
  • Feature: Login Feature
  • Scenario: Verify Login Functionality
  • Given I will open the browser
  • When I will open Facebook website
  • Then Login button should exists
Create StepDefinitions Java Class

import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
import cucumber.api.junit.Cucumber;
import junit.framework.TestCase;
import cucumber.api.java.en.Then;
import org.junit.runner.RunWith;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;public class StepDefinitions{
WebDriver driver = null;
@Given("^I will open the browser$")
public void openBrowser() {
System.setProperty("webdriver.chrome.driver", "chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
}
@When("^I will open Facebook website$")
public void goToFacebook() {
driver.navigate().to("https://www.facebook.com/");
}
@Then("^Login button should exists$")
public void loginButton() {
if(driver.findElement(By.id("u_0_v")).isEnabled()) {
System.out.println("Pass");
} else {
System.out.println("Fail");
}
driver.close();
}
}

Create CucumberRunner.java

import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;@RunWith(Cucumber.class)
@CucumberOptions(
features="Features"
)
public class CucumberRunner {}

SQL to eliminate duplicates while inserting rows from source table to destination table

insert into DestinationTable
select *  from SourceTable a
 where not exists ( select 0 from DestinationTable b where b.primaryKey= a.primaryKey )

Git checkout Flutter projects not able to run in Android Studio

Resolution:
  • Set the Flutter SDK Path - File>Settings(Ctrl+Alt+S). In 'Languages & Frameworks'>
  • Run "Packages get" command

Could not find method signingConfigs() for arguments

Could not find method signingConfigs() for arguments [build_5dw7nwfc8ibd8sagvx4p79x1u$_run_closure5@13e86039] on root project 'android' of type org.gradle.api.Project.

Resolution:

signingConfigs() should be child of android element
android {
  signingConfigs {
      release {
          } 
     } 
     buildTypes {
          release {
              signingConfig signingConfigs.release
          }
      }
  }

How to generate Digital Certificate?

keytool -genkey -v -keystore c:\Users\<user>\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

Best Client Optimized Programming Language for Mobile Development?

Use Google's Dart language, which is Object-oriented, class-based and garbage-collected language with C-Style.  Dart can compile to either native code or JavaScript.

Flutter SDK not installed

This error occurs if Flutter SDK is not installed or SDK Path is not correct in Android Studio.  Check the flutter extracted folder and add to the Flutter Application Project.

Cucumber Eclipse sample program

Cucumber Eclipse SetupCreate Eclipse Maven Project Open pom.xml Goto Dependencies Add GroupId: info.cukes, Artifact Id: cucumber-java, Versi...