Skip to main content

Posts

Maven with IntelliJ

Without going into Maven in depth, let’s start our first JUnit test with Maven. Download and install Maven  if you haven’t done yet. Open up a command prompt (Windows) or a terminal (*uix or Mac), browse to a working directory to setup the project, and execute the following command. mvn archetype:generate -DgroupId=com.test.api -DartifactId=apitest -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false Project will be created as below: CD to created project and enter "mvn test" command It will download the required jars and Build the project and run the tests. Now open IntelliJ and import the project pointing to POM file.
Recent posts

Adding Delay to Jenins Build Steps

For Windows batch Command use below command waitfor SomethingThatIsNeverHappening /t 60 The above command will wait for 60 secs For Jenkins 'Execution Shells' sleep 30s This will sleep for 30 sec and resume the execution

Jenkins CLI examples

Automate Jenkins with the CLI or the REST API Jenkins is used a lot to automate your build process and make it a real continuous integration process. But you can even take it a step further and automate the configuration of Jenkins itself.  In this short instruction I will show two ways to do this: the CLI and the REST API. With these capabilities you can for example write programs to create, backup, restore, start and view Jenkins jobs.  Download the Try-it-out-yourself code to provision an Ubuntu VM with Jenkins installed. This way you can immediately try the examples below.  The CLI   The Jenkins CLI is distributed inside the jenkins.war, but you have to download it before you can use it. Suppose your Jenkins url is: http://localhost:8080/jenkins Then the CLI can be downloaded like this:  wget http://localhost:8080/jenkins/jnlpJars/jenkins-cli.jar Note In the remainder of this document I assume the Jenkins url is http://localhost:8080/jenkins. You shoul

Editable Email Notification configuration for Jenkins Matrix project

hi, I just show how I have configured and the mail notification i get. Steps: 1. Add Archive the artifacts under post-Build action 2. Provide the .xml path which contains the list of tests run with status and details. path should be relative path under workspace 3. Add Publish JUnit test result report under post-Build action 4. Provide the .xml path which contains the list of tests run with status and details, same as step 2 5. Add Editable Email Notification under post-Build action 6. Configure the fields      a.  Recipient List: List of Emails       b.  Content Type: HTML (text/html)       c.  Default Subject:  $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!       d. ${JELLY_SCRIPT,template="html"} 7. Save My Cofiguration looks like Mail look like

Jenkins Matrix Jobs

For many similar different combination build setup. Example Diff OS v/s Diff platform Configuration Matrix CHROME IE Test Module1 Test Module2 Test Module3 Test Module4 Plugin required:  matrix-project Wiki:  https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Project+Plugin Location to download plugin: http://updates.jenkins-ci.org/download/plugins/ Install Plugin: Jenkins>Manage jenkins> Manage Plugin> Advansed> Browse and install Result Look like: Configuration:

Right click and select using Selenium

Steps: 1. Find element/location where you need to right click 2. Create action and do context-click 3. Trigger keyboard event using Robot to select the menu option and enter Code: WebElement ele = driver.findElement(By.xpath(xpathExpression)); Actions act = new Actions(driver); act.moveToElement(ele).contextClick(); act.build().perform(); Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_DOWN); robot.keyPress(KeyEvent.VK_DOWN); robot.keyPress(KeyEvent.VK_ENTER); ** Like if This helps ..