Package: nrobo
nRoBo (An Automated Testing Framework )For Web Developers, QAs and TestersProject StatusActiveOnline TutorialsVISIT and SUBSCRIBE tonRoBo YouTube ChannelPre-requisitesFollowing pre-requisites needs to be installed in order to run*nRoBo*framework.Install Python (3.11 or higher)Check install guide for Pythonpython--version# orpython--versionInstall Java (11  or higher)Check install guide for JavaRun the following command to check if java is installedjava--versionInstall allure command line tool.CheckInstall guideRun the following command to check if allure cli is installedallure--versionInstall Target Browsers on testing systemsChromeEdgeIESafariFirefoxInstallationMake a directory for automation projectmkdir<project-name>Example:If you want to develop autotests for the project,Dream.
You can create directory and change directory todreamas following:mkdirdreamcddreamInstallvirtualenvpackagepipinstallvirtualenvCreate virtual environment - .venvvirtualenv.venvActivate virtual environmentUnix/Mac/Linuxsource.venv/bin/activateWindows.\\.venv\\Scripts\\activateInstallnrobopipinstallnrobo--require-virtualenvInstall & run framework in single commandnrobo--instances10NoteIf there are any errors, run the upgrade command, pip install –upgrade nroboRun testsMinimal switchesnrobo--browserchrome_headless--reportallureTypical usagenrobo--app<app-name>--url<test-url>--username<username>--password<password>--instances<number-of-parallel-tests>--reruns<number-of-retries-to-rerun-failed-tests>--browserchrome_headless--reportallureExample:nrobo--appLotus--urlhttps://www.google.com--usernameshiv--passwordtandav--instances10--reruns2--browserchrome_headless--reportallureAbove command instructs nrobo to do the following actions:Launch the tests of Lotus application from the default test directory, <project-root-dir>, and its subdirectories and generate both, html (plain) and allure (rich) reports for displaying test results with following additional test parameters:Test url (–url switch)Credential: (username, password)=(shiv, tandav)Run bunch of 10 tests at once (–instances switch)Rerun addition 2 times the tests which got failed (–reruns switch)Target browser = Headless Chrome (–browser switch)Command Line SwitchesThis section enlists list of nRoBo-command-line-switches (nCLI) that it supports.
nCLI shadows every PyTest-command-line-switches (PyTestCLI) for backward compatibility with pytest.Thus, nCLI switches are being categorized into three types:Pure-nCLI-switchesOnly nCLI specific switches. Non-PyTest CLI switches.nCLI shadowing switchesThese are PyTest switches overriden by nCLI with a new long or short name. These are at core, pure PyTest switches.Pure-PyTest-CLI-switchesAs the name suggests, it is self explanatory that these switches are pure PyTest switches and maintained by them.Below is a list of switches including all the three types categorically.Pure nCLI Switches-i,--installInstall nRoBo requirements and framework on host system--appName of application under test.
Name should not include special chars and it should only having alphanumeric values.--urlApplication url under test.--usernameUsername for login.--passwordPassword for login.-n,--instancesNumber of parallel tests to reduce test-run-time.
Default value is 1. Meaning single test at a time in sequence.--reportDefines type of test report. Two types are supported, Simple HTML or Rich Allure report.
Options are <html> or <allure>. Default is <html>-b,--browserTarget browser. Default ischrome.
Following is a list of browser options support in nRoBo.chrome,chrome_headless,edge,edge_headless,safari,firefox,firefox_headless,ie--browser-configPath of browser-config-file containing additional options that is/are needed to be applied
before browser instantiation. Each line in file should contain one option only.For example: You want to apply, –start-maximized, chrome switch for chrome browser.
and if the browser-config-file is names as ‘chrome_config.txt’, then
the content of file would be as following:–start-maximizedThere will be no conversion taking place by nRoBo!
The browser switches will be applied to the browser instance.--gridRemote Grid server url.
Tests will be running on the machine when Grid server is running pointed by Grid url.nCLI Shadowing Switches-k,--keyOnly run tests that match the given substring
expression. An expression is a python resolvable
expression where all names are substring-matched
against test names and their parent classes.Example:-k ‘test_method or test_other’ matches all test.yaml functions and
classes whose name contains ‘test_method’ or ‘test_other’,
while -k ‘not test_method’ matches those
that don’t contain ‘test_method’ in their names. -k ‘not test_method
and not test_other’ will eliminate the matches.
Additionally keywords are matched to classes
and functions containing extra names in their ‘extra_keyword_matches’ set,
as well as functions which have names assigned directly to them.
The matching is case-insensitive.Note: –key switch is shadowing -k switch of PyTest for the sake of readability.-m,--markerOnly run tests matching given mark expression.
For example:
-m ‘mark1 and not mark2’Pure PyTest CLI Switches--rerunsRetries to rerun the failed tests n times specified by –reruns switch.--reruns-delayDelay time in second(s) before a rerun for a failed test. Default is 1 second.--markersShow markers (builtin, plugin and per-project ones).--junit-xml–junit-xml=path. create junit-xml style report file at given path.--rootdir–rootdir=ROOTDIR. Define root directory for tests.
Can be relative path: ‘root_dir’, ‘./root_dir’,’root_dir/another_dir/’; absolute path:’/home/user/root_dir’; path with variables: ‘$HOME/root_dir’.--co,--collect-onlyonly collect tests, don’t execute them.Note:Full list of PyTest switches are enlisted and explained at the following web address:Pure PyTest CLI SwitchesFull list of all switches can be seen by running the following nrobo cli:nrobo-h#ornrobo--helpnRoBo shadows all the PyTest switches, so no need to worry about. We can use each of them within the nRoBo framework. Isn’t it great!PersonalizationNoteThis section will be updated soon!ReportsSupport for two kinds of test reports:Lightweight HTML Report (Best for sharing test results)Go to<results>dir and Double click on <report.html> file to view the simple html report.Rich Allure Pytest Report (Best for visualization)Make sure *allure-pytestcommand line tool is installed!*To check, run the command:allure--versionIf not installed, please go throughPre-requisitessection above.Run the following command:allureserveresults/allureVideosNoteThis section will be updated soon!Features@ @Easy and standard install - BynRoBo]Easy to learn and use - BynRoBo]Simple and Well Defined Automation Directory Structure - BynRoBo]Report Customization - BynRoBo]Rich Command Line Support that helps integration with CI/CD pipeline or any DevOps tech. - BynRoBo]Shipped with rich set of examples along with install. Thus, speedup learning. - BynRoBo]VISIT and SUBSCRIBE to DedicatednRoBo YouTube channelwith a collection of video tutorials. Thus, speedup learning. - BynRoBo]Ready to use framework loaded with power of PyTest, Selenium Webdriver 4, HTML Report, Rich Allure Report and other tools. BynRoBo]Ability to organize tests in Groups. Inbuilt groups are sanity, ui, regression, nogui, api at present. - ByPyTestandnRoBo]Rich Browser Support (Chrome, Headless Chrome, Edge, Safari, Firefox, FireFox Headless, IE) - BySeleniumWebdriverRich Platform Support (Unix, Linux, Mac, Windows) - ByPyTest,SeleniumWebdriverandnRoBo]nRoBo selenium wrapper classes and methods that saves lot of key presses. Thus, leveraging benefits of compact, readable and manageable of code. - BynRoBo]Well-structured thread-safe inbuilt setup and tear down processes. Thus, You can keep focus on testing! Not on maintaining framework. - BynRoBo]Test Parallelization - Inherited fromPyTestDistributed testing over Grid infrastructure - Inherited fromSeleniumWebdriverTest parameterization - Inherited fromPyTestScreenshot-capture at the end of each test - Inherited fromSeleniumWebdriverCapture webdriver logs, console logs and screenshots in reports - Inherited fromPyTestInbuilt integration with NxGen Rich Allure Report (Backed byAllureReports andpytest-html-reports)