Sikuli Overview

Sikuli is a Desktop Automation library. This library “sikulixapi.jar” can be imported to any Java Selenium project to automate any desktop app or popup.
Sikuli uses “Screen” Class and it has lots of methods to support GUI interactions.E.g. Screen s = new Screen();s.click(“imageOfButton.png”);Note: Store imageOfButton.png at java root project folder.
Similarly you could do type, doubleClick, find etc methods provided by Screen class.
Sikuli automation is very simple and can be used to replace many day today tasks on outlook, windows software center installation. With that said sikuli can replace some of the robotic process automation done by many tools like Automation Anywhere, UiPath etc.

What is Sikuli Screen, Region, Pattern ?

Sikuli Screen is a class that has lots methods like click, double click, find etc to interact desktop GUI images.

Region class is to target a rectangular area location on GUI using x,y coordinates and width and height to locate the rectangular area.

Pattern class used for image level scanning support

Sikuli Architecture:

Sikuli scripts have Java library that takes care of mouse and keyboard actions using java.awt.Robot. Apart from this, Sikuli using OpenCV library which is C++ engine connected to Java via JNI. OpenCV is a computer Vision and machine learning library used for image recognition.

What is JNI

JNI is Java Native interface, it is java programming interface used to bridge the Java and other non java programming language like C, C++ application/programming frameworks

What is Protractor testing framework

Protractor is a test framework mainly intended for Angular and AngularJS applications.

During Protractor execution you no longer need to add waits specifically to wait for your next test. Protractor can automatically execute the next step in your test the moment the webpage finishes pending transaction.

Protractor expected condition setting code sample below:

var expectedCondition = protractor.ExpectedConditions; var elementOne = element(by.id(‘UserId’)); browser.wait(expectedCondition.presenceOf(elementOne), 10000); expect(elememtOne.isPresent()).toBeTruthy();

Protractor vs Selenium

Protractor vs Selenium

Protractor is a test framework mainly intended for Angular and AngularJS applications. Where as Selenium is developed for any Web Browser Automation. 

During Protractor execution you no longer need to add waits specifically to wait for your next test. Protractor can automatically execute the next step in your test the moment the webpage finishes pending transaction, but in selenium webpage sync has to be coded.

What is Selenoid

What is Selenoid ?

Selenoid is an alternative solution for Parallel Selenium test execution when you are not looking for Selenium Grid or Docker selenium.

Like the way Docker selenium out perform over selenium grid, Selenoid also has the advantage over selenium grid being dockerized.

Selenoid has successful implementation of docker containers to kick start browser tests. It provides fresh environment for each test.

In selenoid tests, containes starts with test and getting removed with test execution ends. This gives good performance for this design.

as first step of configuration , you may need to install docker and run selenoid on docker containers. Selenoid-ui is used to track test execution gui mode.

How to Validate the XPATH is correct in Selenium automation

How to validate XPath?
In console type $x(“paste xpath here”) and enter. Result should show the correct element pointing to the xpath.For css, try with $(“paste css here”)
Customized XPath
From html code, we can create XPath and validate.
\\tagName[@attribute=‘value]
Css can created using below formula from html code.
tagName[attribute=‘value’]
Mouse interactions- Actions Class
create an object and use moveToElement and build().perform() method

What is REST client in Visual studio code

REST client is an extension available in Visual Studio code available through its market place.
REST client make API test automation easy via Visual studio code development. 

Consider a scenario where you needed to handshake selenium UI automation with API REST calls, normally you would need to do coding effort for REST calls. In this case REST client makes life easy.
Please find below example on REST client coding:
GET transaction for getting a response

# codes starts here
GET https://endpointurl/xxxxx

Authorization: {{“token”}}

# code ends..

Note : you can pass token as variable as well.
Similarly POST, or PUT works and needs the json input file/string to be attached with POST, PUT request

What is Automagica

Automagica is Smart robotic process automation (SRPA) tool and best matches for Windows automation. Aytomagica is built on the following open source libraries,

PyPDF2
Psutil
py-trello
plyer
Pillow
Faker
Psutil
Keyring
PySimpleGUI
Cryptography
PyAutoGUI
Selenium
PyWinAuto
OpenPyXL
python-docx
pywin32
pyttsx3
pyad
jupyterlab
SRPA Automagica automates windows paint, excel,  sap apps etc.

How to run selenium on linux server using Firefox binary

How to run selenium on linux server using Firefox binary

String Xport = System.getProperty(“lmportal.xvfb.id”, “:1”); // setup firefox binary to start Xvfb
final File ffPath = new File(System.getProperty(“lmportal.deploy.firefox.path”, “/usr/bin/firefox”));
FirefoxBinary ffBinary = new FirefoxBinary(ffPath);
ffBinary.setEnvironmentProperty(“DISPLAY”, Xport);

WebDriver driver = new FirefoxDriver(ffBinary, null);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(“URL”);