Posts

Showing posts from April, 2020

Install Docker on Ubuntu 16.04

Install Docker on Ubuntu 16.04 Docker Engine is an open-source containerization technology for building and containerizing your applications. Docker Engine acts as a client-server application with: A server with a long-running daemon process dockerd . APIs which specify interfaces that programs can use to talk to and instruct the Docker daemon. A command-line interface (CLI) client docker. To install Docker on your Ubuntu 16.04 machine, follow the following steps. Install Dependent packages:   Update the package index and install packages to allow apt to use a repository over HTTPS. sudo apt-get update   sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common Add repository key:    Add repository key to the package manager curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - Verify fingerprint:    Verify that you now have the key with the fingerprint sudo apt-...

Selenium Grid using Zalenium

Image
Selenium Grid using Zalenium Zalenium is a flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard. To setup Zalenium, follow the following steps. Prerequisite:  Docker is pre-installed. Pull Docker Images:  Pull the elgalu selenium and zalenium docker images. docker pull elgalu/selenium   docker pull dosel/zalenium Run Zalenium:  Start zalenium using the command docker run --rm -ti --name zalenium -p 4444:4444  -v /var/run/docker.sock:/var/run/docker.sock  -v /tmp/videos:/home/nishant/videos --privileged dosel/zalenium start Stop Zalenium:  To stop zalenium run the command docker stop zalenium Access Selenium Hub:  Access the selenium hub   at   http://localhost:4444/grid/console   Access Selenium Grid Live View:  Access the selenium grid live view at   http://localhost:4444/grid/admin/live   Access Zalenium Dashbo...

Setup WordPress with MySQL using Docker Compose

Setup WordPress with MySQL using  Docker Compose Prerequisite:  Docker and docker-compose are installed. Create YAML File:  To create a docker-compose YAML file for Wordpress, create a new YAML file with the below content. wordpress-mysql .yaml version: '3.3' services:    db:      image: mysql:5.7      volumes:        - db_data:/var/lib/mysql      restart: always      environment:        MYSQL_ROOT_PASSWORD: test123!        MYSQL_DATABASE: nishantmysql        MYSQL_USER: nishant        MYSQL_PASSWORD: test123!    wordpress:      depends_on:        - db      image: wordpress:latest      ports:        - "8000:80"      restart: always      environment...

Setup Selenium Grid using Docker Compose

Setup Selenium Grid using  Docker Compose Prerequisite:  Docker and docker-compose are installed. Create YAML File:  To create a docker-compose YAML file for Selenium Hub, create a new YAML file with the below content. seleniumgrid .yaml version: "3" services:   selenium-hub:     image: selenium/hub:3.141.59-20200409     container_name: selenium-hub     ports:       - "4445:4444"   node1:     image: selenium/node-chrome-debug:3.141.59-20200409     volumes:       - /dev/shm:/dev/shm     depends_on:       - selenium-hub     environment:       - HUB_HOST=selenium-hub       - NODE_MAX_SESSION=10        - NODE_MAX_INSTANCES=10       - HUB_PORT=4444   node2:     image: selenium/node-chrome-debug:3.141.59-20200409     volumes: ...

Setup Selenium Grid using Kubernetes

Setup Selenium Grid using  Kubernetes Prerequisite:  Kubernetes is installed along with minikube if you are running in your local. Create Deployment:  To create a Kubernetes deployment for Selenium Hub, create a new YAML file with the below content. seleniumdeployment.yaml apiVersion: apps/v1 kind: Deployment metadata:   name: selenium-hub spec:   selector:     matchLabels:       app: selenium-hub   strategy:      type: RollingUpdate     rollingUpdate:       maxSurge: 1       maxUnavailable: 0         template:     metadata:       labels:         app: selenium-hub     spec:       containers:       - name: selenium-hub         image: selenium/hub:3.141.59-20200326         resources:     ...

Install and Setup MySQL on Ubuntu

Install and Setup MySQL on Ubuntu MySQL is an open-source relation database management system which is fairly easy to use and is the first choice for many to handle basic database requirement for their applications. To setup MySQL on your ubuntu system follow the steps below. Install MySQL: To install MySQL update the ubuntu package index and install the package using Ubuntu package manager: sudo apt-get update   sudo apt-get install mysql-server Setup Security: You will be promoted to setup root password during installation, set up a password you can remember as you are going to need it later. If you were not asked to set up your root password  or if you wish to change any of the security settings such as disallowing remote login , you can do so by running the command sudo mysql_secure_installation utility Open Port: If you wish to connect to the MySQL database from another machine or from an application hosted on a different server, you need to open a port...

Get rid of "Timed out receiving message from renderer"

Get rid of "Timed out receiving message from renderer" Message Well, if you using selenium web driver to automate your web flows you must be really annoyed by now with the console log [SEVERE]: Timed out receiving message from renderer: 0.100 This not only gives us a false impression of some error happening during the run but also makes it difficult to go over the console logs. Luckily, we can make use of the silent output mode in chrome to get rid of these messages. To do so we need to set the silentOutput parameter to true in System property as follows. System.setProperty("webdriver.chrome.silentOutput", "true"); and voila...no more annoying timeout message.   If you don't want to use setting the system property way for any reason, there is another way for you to achieve this. You can make use of ChromeDriverService builder to build it with " withSilent " set to true in the code as below.   ChromeDriverService.Builder bu...

Intellij JAR Remote Debugging

Image
Intellij JAR Remote Debugging Prerequisite: The code used to generate the JAR deployed on the remote location and the code on the local machine should be the same. Click on Edit Configurations option in Intellij and create a new Remote configuration Enter the Host IP  in the Host field and the below command in the command line arguments for remote JVM field -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 Save the remote configuration  Put the necessary breakpoints in place Run the JAR on the remote server using the command java -jar -Xmx2g -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 your-jar.jar argumen1 argument2  You will see that your program is not executing but instead listening to the port you mentioned in the command  Now select the remote configuration we created earlier in Intellij and click on Debug button, your code will now start executing and you will be able to debug the code.