The libraries contain the most important and useful C# methods for test automation in Ranorex IDE.
- Windows
- Ranorex Studio
- download the libraries (*.cs files);
- add (or link) this *.cs files in your project;
- use the methods in yours record or code modules;
- openApp() to run 32-bit or 64-bit application (AUT);
- deleteRegKey() to delete from the registry the key for application;
- rmDir() to remove such traces of an application (AUT) like \Documents, \Roaming and s.o.;
- createNewProject() to start an application (AUT) and create a new project in it (as GUI method example);
- openProject() to open a specific project in application (AUT) (as GUI method example);
- resizeWindow() to resize an AUT window to actual monitor resolution;
- deleteFilesFromDir() to remove from \FolderResult all files created during the test run;
- checkDump() to send a dump with a comment (as GUI method example);
- createFolderResult() to create a results folder for each test product (AUT).
SetKeyboardLayout TestModule is using to change Windows OS keyboard layout using C#. For example, U.S. English layout = "00010409", German layout = "00010407", Russian layout = "00010419". More Info from MSDN.
TheFirstRun TestModule is using to run 32-bit or 64-bit test application and resize window.
StartPopupWatcher TestModule is using to start a PopupWatcher to handle dialogs that can possibly come up during test run.
- closeApp() to find and kill process of test application (AUT);
- cleanUpResultsFolder() to delete a results folder for each AUT;
- closeProjectWindow() to close the test product (as GUI method example);
- closeAppInstances() to close all instances of AUT;
- killProcessTree() to kill a process tree and all children using taskkill;
- killProcessAndChildren() to kill a process and all children using ManagementObjectSearcher.
#region Data
- removeCharsInString() to remove the last characters of string;
- getFirstChars() to get first characters of string;
- getLastChars() to get last characters of string;
- concatenateStrings() to concatenate two strings;
- compareStrings() to compare strings;
- validateAttIsNullOrEmpty() to validate the attribute value of repoItem isn't null or empty;
- getStringToLower() to get a new string in which all the characters are converted to lowercase;
- getStringToUpper() to get a new string in which all the characters are converted to uppercase;
#region DateTime
- getCurrentDate() to get current date with specified format;
- getDateInNewFormat() to get different date format;
- addMonths() to add months to date (the same you can do with days or years);
- getFileCreationTime() to get the time of file creation;
#region Files
- getFileName() to get file[0] name if exists;
#region DevExpress
- getCoordinates() to get a coordinates of text in the PDF file.
#region randomGenerators
- generateRandomString() to generate random string;
- generateRandomInt() to generate random integer;