Posts

Showing posts with the label robotframework

How to pass **kwargs values from Robotframework to python class

At times its become very confusing how to pass **kwargs values to robotframework. In below post , i will try to explain you , how you can pass your **kwargs value to python class from robot file. Lets suppose we have file Demo_kwargs.py , which accept  **kwargs value from the user. Demo_kwargs.py from subprocess import Popen, CREATE_NEW_CONSOLE,PIPE,STDOUT import time import subprocess import datetime import os class Demo_kwargs: """Demo class""" def __init__(self,**kwargs): self.filters='' self.window_ip = kwargs.get('ip') #print type(self.window_ip) self.window_user= kwargs.get('username') self.window_password= kwargs.get('password') self.dest_path= kwargs.get('Target_path') self.interface= kwargs.get('interface') se...

How to communicate between two windows machine and executing command on remote machine

Image
I am working as an  Automation engineer and using Python and Robot framework to do my tasks in hand.Recently i had requirement in my project to make communication between two windows machines and execute command on remote machines.  For Linux machines we have ssh client/Server software installed by default , in windows we don't have ssh. I tried with  three options on windows 1)      Pywinrm – Unstable, bug prone. its a python library 2)      Winrm –  Its windows default functionality to communicate with other windows machine , looks bit complicated to use 3)      Paramiko  -one need to  install free SSH client software, however this has its own limitation when you are trying to configure it After trying above , i came across with pstools   Advantage 1)  This need not to be installed at remote desktop, so remote machine would be untouched 2)   it is...

How to use custom library in Robot Framework

Image
RobotFramework have rich set of libraries to do all the necessary tasks, but sometimes we are not that much familiar with the library and we want to write our own method and want to import that method as a library in RF. Let me take an example here, suppose you have a CSV file data.csv Name,Age,region,country,Marks pankaj,22,delhi,india,45 neeraj,32,noida,india,75 Task is to find value of 2nd Row and 3rd Column from a Robot Script. How one like to proceed from here ?. There are two options to do this 1. Using existing Libraries developed by other users you can use libraries created by other users and see if that solves our purpose e.g. for this use-case you can search some csv library for robotframework available in git hub These libraries have enough documentation and example to download and use them.  2.Creating our own library to do the task if you are well versed in python or java and if you know how it can be done in your...

Why to use Robotframework with Selenium

Use Case: You need to write a framework to automate your webrowser Confusion of Selection You have selenium to automate all the web related work e.g login,click,button and many more thing.But,then you have to use it with some languages , e.g. Java ,Ruby, Python. Suppose you get a project to automate a webbrowser by using any other languages , where your task would be 1)login to browser 2)Fill user details 3)Click on submit Now to have a good framework , you need to break down these tasks into smaller component 1) you need to define test cases 2) You need to have a separate file to store variables 3) You need to have a good reporting tool , which will show how many test cases passed or failed and further drill down. I am a python user,so lets talk the problem with python,selenium Python-Selenium drawbacks 1) you can write the test cases with unit test module ,But then generating a good test reports would be headache , you have to spend a lot of time to create good test reports 2) Dri...