Posts

Mobile Testing with Appium

Image
How to Start Appium For testing mobile app with Appium you need to install it on you machine first, here you can download Appium client libraries and Desktop Apps. Please read more about Appium to figure out its philosophy. Few words about Appium architecture: Appium has different client libraries, for writing a script in general we you some IDEs such as IntelliJ, Eclipse, Visual Studio, etc. When you launch your Appium server and create a new driver (Andriod/iOS), the session will be created by Appium server according to the Capabilities you defined in your script. Capabilities are type of configurations that needed by Appium to create the session, when the server gets the capabilities it creates a session (driver) in order to perform actions on your app. Once you get the driver you can perform UI actions using different driver engines like XCUITest and UIAutomator. The engines will help you to execute your tests on the app UI. Note: For creating a session on App...

How to Customize TestNG Emailable Report ?

Image
TestNG emailable reports are too bad and unreadable, in this post I'll illustrate the we send and improve the reports using TestNG IReport listener. The report includes the number of passed, failed, and skipped tests with execution times and test names. If you are using a CI tool such as Jenkins pipeline, you can add a new stage for emailing this report to the dev team. Nightly builds need to be daily supervised by the dev team in your organization so that if you summarise failures with this readable report would be helpful to catch bugs of newly deployed versions. Now I'm sharing the java listener for generating the HTML report with test results. After you add this listener to your java project, you need to add it to your xml runner file like this: <listeners> <listener class-name="automationInfra.com.listeners.CustomizedEmailableReport"> </listener> </listeners> Now we back to Jenkins pipeline send email stage, in y...

Install Jenkins on AWS EC2

Image
Install Jenkins on AWS EC2 Login to AWS Instance Become root using: sudo su Update yum yum update Get Jenkins repository sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat/jenkins.repo Get Jenkins repository key sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key Install jenkins package yum install jenkins Start Jenkins service jenkins start chkconfig jenkins on Notes: If you encountered jenkins dead but pid file exists error, please restart jenkins using this command: Sudo service jenkins restart OR Stop all processors with 8080 port. OR Got to /etc/sysconfig/jenkins file and add JENKINS_PORT="8070" after daemon word. If you don’t have the permission to do that, change folder permission by: Cd  /etc/sysconfig/ Chmod 777 jenkins The file should look like this: # Search usable Java as /usr/bin/java might not point to minima...

Jenkins Configurations - Linux

Image
Jenkins Configurations - Linux Install Git yum install git Install Java Install Maven sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo sudo yum install -y apache-maven mvn --version Jenkins Get Started Get jenkins Admin Password cd /var/lib/jenkins/secrets cat initialAdminPassword Install needed Plugins Create Admin User and Get Started Install Plugins: Maven Integration, Github Integration, TestNG Results. Create new jobs by selecting Maven project In build section Root POM /var/lib/jenkins/jobs/Automation/workspace/pom.xml Goals and Options clean test -DxmlPath=/var/lib/jenkins/jobs/Automation/workspace/src/test/java/runners

Add customized jar as Maven Dependency

Add customized jar as Maven Dependency This example used for creating new customized ReportNG jar as maven dependency. Go to jar file location. Open cmd window in the jar located folder. Run this CMD maven command: mvn install:install-file -Dfile=reportng-mobileODT.jar -DgroupId=reportng-mobileODT - DartifactId=reportng-mobileODT -Dversion=1.0 -Dpackaging=jar After build success, go to pom.xml file in eclipse. Click on Window => Show View => Other => Maven => Maven Repositiries. Right click on Local Repositories => Rebuild Index. Right-click on the project -> Maven -> Add Dependency. Fill the groupid of jar and fill required fields. Build project. Notes: Please make sure that you have maven installed in your local machine .

Handling Selenium Grid Exceptions

Most Common Selenium Grid Exceptions While implementing the Selenium Grid I encountered few exceptions that wasted my time, here is how to handle following exceptions: Exception: org.openqa.selenium.WebDriverException : Error forwarding the new session cannot find : Capabilities [{browserName=internet explorer, version=11, platform=ANY}] Command duration or timeout: 441 milliseconds Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' System info: host: 'WIN-HLIR99M6TU9', ip: '172.31.1.229', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_111' Driver info: org.openqa.selenium.remote.RemoteWebDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0( Native Method ) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructor...