Month: March 2018

OCR Using Testmate

Testmate uses Tesseract to provide OCR support. Tesseract is an optical character recognition engine for various operating systems. It support a lot of languages, complete list can be found here. To use Tesseract, all you need to do is download tessdata  library. Use the below code to OCR the image: 1 2 3 4  

Automate Images Using Testmate

Testmate can automate anything you see on the desktop screen. It can identifies the images and perform actions on them. It is useful when the objects are not identifiable using standard methods. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 'Highlight the image on the desktop Call img.HighlightImage("C:\Users\...\Desktop\Capture.png")  

Mouse Clicks & Key Press Using Testmate

Testmate allows you to simulate keystrokes and mouse clicks as below. Mouse Click 1 2 'Perform mouse click on the entered x and y co ordinates Call native.MouseClick(5,5)'Perform mouse click on the entered x and y co ordinates Call native.MouseClick(5,5) Mouse Right Click 1 2 'Perform right mouse click on the entered x and y

How to invoke external DLL’s | Vbscript

Testmate provides you the capability to invoke procedures in external DLL’s. The below code demonstrates the usage of  LoadAndRun method to invoke SetForegroundWindow  method from user32.dl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 'Declare The DLL to be used sDLL = "user32.dll"   'Declare the reulrn

Appium | Automate Android Application Using Testmate

Appium is an open source test automation framework for use with native, hybrid and mobile web apps.  Testmate allows you to program Appium using vbscript. Setup Turn on AVD (Using Emulator) or connect a real android device Turn on the Appium Server Run the below code with correct device name and other capabilities The below code invokes

Webdriver | Launch Edge Browser Using Testmate | VBScript

The below code launch the Edge browser using Testmate. Webdriver needs MicrosoftWebDriver.exe file to launch chrome browser. Download the latest version here 1 2 3 4 5 6 7 8 9 10 11 12 13 14 'Initialize edge driver wd.EdgeInitializeDriver("C:\Users\...\EdgeDriverPath")   'Navigate the URL wd.NavigateToUrl("https://www.facebook.com/")   'Highlight the control wd.Highlight("id::email")   'Send Keys in Email textbox

Webdriver | Execute JavaScript Using Testmate

JavaScript is one of the most preferred language used in the web browsers. A Browser has JavaScript implementation in it and interprets the JavaScript commands. WebDriver gives you a ability to executes the JavaScript in context of the loaded browser page. The Testmate code to execute JavaScript is as below: 1 2 3 4 5

Webdriver | Work With Multiple Browsers | Driver Parking

Driver parking is a concept which allows working with multiple browsers without loosing the instance of any. It allows the storage of additional 5 drivers which can be switched with the host drivers by using inbuilt methods. The below test demonstrates the use of two additional drivers. 1 2 3 4 5 6 7 8

Webdriver | Drag And Drop Using Testmate | Action

The action class in selenium is used for emulating complex user gestures. The sample of action using Testmate, performing drag and drop operation is as below:   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 'Initialize the driver Call wd.FFInitializeDriver("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")