Skip to main content

Posts

Showing posts with the label software testing

Modify and build your own SikuliX

In this tutorial, I show steps to modify and edit sikulix under OSX environment. This should not be different with other *nix environment. However, for windows environment, you may need to adjust yourself. Modify your code Clone from the repository Open the repository as maven project in netbeans. You can easily use this button to open the project You will see that the cloned project appeared in open windows like the following Open the project. It will be like this Modify any part you want to modify Clean and build the maven project. If you open other sub project of sikulix, make sure that you clean and build only the main sikulix maven project Create Installer Go to File Finder in the repository folder. You will see one file named runSetup. Using your terminal and cd to the folder and run the setup. $ runSetup It will bring you to SikuliX installation. Please remember that if you build yourself, ALWAYS do it in offline mode, means that you are n...

How To Make Program to Corrupt File (Java)

Sometime we intentionally want our file to be corrupted e.g. to test software reliability. So, I made a program in Java that intentionally corrupt file. Please be careful to use this program as this program will make your file corrupt and cannot be reverted. Please backup your file before making it corrupt. OK, the logic is very simple. For each byte in the file, I simply put any random character (ASCII character is from 0 to 255). Here is the complete Java program: import java.io.RandomAccessFile; import java.util.Random; /**  *  * @author arwankhoiruddin  */ public class CorruptFile {     /**      * @param args the command line arguments      */     public static void main(String[] args) {         // TODO code application logic here         String FILEPATH = args[0];         System.out.println("File to corrupt: " + FILEPATH);     ...

Sikuli Tutorial - Detect any activity in monitor

This script is used if we want to detect if any activity(ies) happen in monitor using Sikuli . The idea is simple: 1. Capture the screen, 2. Take another capture after certain time interval 3. Compare the second capture to the first 4. Delete temporary image Here is the script (I use python script) def activityDetected():     screen = Screen()     while True:         file = screen.capture(screen.getBounds())         sleep(2)         file2 = screen.capture(screen.getBounds())         f = Finder(file)         f.find(Pattern(file2).exact())         matchVal = f.hasNext()           f.destroy()                  os.remove(file)         os.remove(file2)         if matchVal:             return Fal...

Automated Software Testing: Handling Memory Problem in Sikuli

One of the most important step in software engineering is software testing. Proper software testing will dramatically reduce the risk during software implementation. By the end of the day, testing will ensure your stakeholder about the quality of your software. When you find a bug, you will assign a task to developer to fix it. When the developer has fixed the bug, it will be reassigned back to you. When you find another bug, you and the developer will do it again and again. Bad news is, when your program is fixed in one part, sometime it will make trouble in other part. Sometime what you have found as bug and then fixed, it will be bug again when the developer works in another part or your software. Thus, we have to do thorough testing for each release to ensure that no bugs are re-introduce. Isn't it boring? Yes, doing repetitive task (especially if the developer make daily release) will be boring. Thus, we need to automate our testing. You can do automation with any softwa...