Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Ranorex - Test and Automation Lib [C++/Python/NETs]


  • Please log in to reply
14 replies to this topic
BoBo
  • Guests
  • Last active:
  • Joined: --

Automated software testing with Ranorex
Ranorex is a Windows GUI test and automation Library for C++, Python and for the .Net languages. Ranorex doesn't have a scripting language of its own like other test tools. The user (e.g. the software tester) should use the functionalities of the powerful programming languages like Python or C # as a base, and enlarge it with the GUI automation functionality of Ranorex.

Use our software automation tool to control your Windows GUI Applications. Apply Ranorex for effective software tests to guarantee your software quality. Make small automated scripts for repeated actions. Embed our automation library in your software project to be able to run automated GUI operations. Ranorex is able to access all elements in a windows application or web page.

Ranorex works with Windows 2000, Windows XP and Windows Vista.

Ranorex is Freeware. You may use this software for free as long as you want.

[More..]

8)

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
That is absolutely fantastic !!!!!!!!!!!!!!

I suggest everybody to download Ranorex and to try sample applications and see the docs.


I know just one thing: I start to learn Python today :)
Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

I start to learn Python today :)

Basically, it seems to be a good idea... Lot of people say it is a fine language.
I want to learn since a long time, but never took time to loop deeply inside.

BoBo, this is a good finding. This is not the first test automation tool, but these are rarely free... Looks like a serious concurrent of AutoHotkey... and AutoIt! ;-)
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

Lot of people say it is a fine language.

Yeah, I heard good stories about it to, from very respectable programmers.

Looks like a serious concurrent of AutoHotkey... and AutoIt!

My thought too.
Looks like your LUA idea is here, just with Python. :)


This is sample script from documentation:

#---------------------------------------------------------------------------------------------
# CalcTest1-de.py - Python testscript for Ranorex
#---------------------------------------------------------------------------------------------

"""CalcTest1-de.py -- demonstrates automated GUI testing of calc.exe with Ranorex
(german OS version)

Usage:  CalcTest1-de [sleeptime]

  sleeptime ... Integer value between 1 and 10000, indicating the interval (in milliseconds) you want the
  script process to be inactive between the commands (default=500). 

CalcTest1-de.py demonstrates searching of forms, finding of controls by name and
clicking of buttons
"""

__version__ = 1, 0, 0

import sys
import RanorexPython as Ranorex

TESTED_APPLICATION_PATH = 'calc.exe'        # Name of the application
TESTED_APPLICATION_TITLE = 'Rechner'        # Title of calc.exe in german version

def printerror(*args):
    msg = ' '.join(args)
    sys.stderr.write(msg)
    sys.stderr.write("\n")

def main():
    if len(sys.argv) > 2:
        printerror("Too many arguments!\n\n" + __doc__)
        return 1

    sleeptime = 500
    # Reading sleeptime
    if len(sys.argv) == 2:
        sleeptime = int(sys.argv[1])
        if sleeptime < 1 or sleeptime > 10000:
            printerror("Arguments error, use a value between 1 and 10000!\n\n" + __doc__)
            return 2            

    print '---------------------------------------------------------------------'
    print ' General functions'
    print '---------------------------------------------------------------------'
    Ranorex.SetSleepTime(sleeptime)
    sleeptime = Ranorex.GetSleepTime()
    print '  SleepTime=' + str(sleeptime)
    Ranorex.Sleep(100)

    print '---------------------------------------------------------------------'
    print ' Activating Form: ' + TESTED_APPLICATION_TITLE
    print '---------------------------------------------------------------------'
    form = Ranorex.FormFindTitle(TESTED_APPLICATION_TITLE)
    if form == 0:
        print '   Form not found, starting application...' + TESTED_APPLICATION_PATH
        ret=Ranorex.ApplicationStart(TESTED_APPLICATION_PATH)
        if ret != 0:
            print '\nERROR: Cannot start application, please start the tested application calc.exe start the script again'
            return 3
        print '   Activating test application...'
        form=Ranorex.FormFindTitle(TESTED_APPLICATION_TITLE,Ranorex.MATCH_EXACT,1,5000)
        if form == 0:
            print 'Error: Form not found'        
            return 4
    print '   Form found, form=' + hex(form)


    print '--------------------------------------------------------------------'
    print ' Searching and testing buttons'
    print '---------------------------------------------------------------------'
    print '  searching button 2 by text'
    button2=Ranorex.FormFindChildText(form,'2',Ranorex.MATCH_EXACT)
    if button2 == 0:
        print 'ERROR: button button2 not found'
        return 5
    print '    button2=' + hex(button2)
    if Ranorex.ButtonClick(button2) == False:
        print 'ERROR: pressing button2'
        return 5           

    print '  searching button * by text'
    buttonx=Ranorex.FormFindChildText(form,'*',Ranorex.MATCH_EXACT)
    if buttonx == 0:
        print 'ERROR: button buttonx not found'
        return 5
    print '    buttonx=' + hex(buttonx)
    if Ranorex.ButtonClick(buttonx) == False:
        print 'ERROR: pressing buttonx'
        return 5           
 
    print '  searching button 3 by text'
    button3=Ranorex.FormFindChildText(form,'3',Ranorex.MATCH_EXACT)
    if button3 == 0:
        print 'ERROR: button button3 not found'
        return 5
    print '   button3=' + hex(button3)
    if Ranorex.ButtonClick(button3) == False:
        print 'ERROR: pressing button3'
        return 5           

    print '  searching button = by text'
    buttoni=Ranorex.FormFindChildText(form,'=',Ranorex.MATCH_EXACT)
    if buttoni == 0:
        print 'ERROR: button buttoni not found'
        return 5
    print '   buttoni=' + hex(buttoni)
    if Ranorex.ButtonClick(buttoni) == False:
        print 'ERROR: pressing buttoni'
        return 5           

    print '--------------------------------------------------------------------'
    print ' Closing application: ' + TESTED_APPLICATION_TITLE
    print '---------------------------------------------------------------------'
    Ranorex.ApplicationClose(TESTED_APPLICATION_TITLE)
    Ranorex.Sleep(1000)
    print 'End'

if __name__ == "__main__":
    ret = main()
    sys.exit(ret)


Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

Looks like your LUA idea is here, just with Python. :)

A Lua binding can be done easily too... It is just some work.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Lets hope this is true

Hi,



Thank you for your suggestion, it seems to be a very good idea.

We will discuss it for a feature release.



Best Regards



Jenö Herget

www.Ranorex.com




--------------------------------------------------------------------------------

From: Miodrag Milic [mailto]
Sent: Tuesday, November 21, 2006 10:16 AM
To: [email protected]
Subject: ranorex suggestion



Hi there.


I am wondering is it fesible to support hotkeys in ranorex. I know it is off-topic when automatition is in question in the core sense, but in practice it is extremely useful as proved by AutoHotKey project. AutoIt droped easy usage of hotkeys and bunch of users changed to AHK becaues of this (among other reasons)



In Ahk u can define whatever you like for hotkeys, not only ctrl shift alt combinations.

So you can for instance create handler for a+b. The syntax is very cool:



a&b::

WinGetActive ...

WinSetTitle ...

Click ...

return



or



MButton::AltTabMenu



It would be really nice to add such support natively in Renorax. Such thing can be done via system hooks, and also AHK is open source if you want to chek it out.





Thx for your time



Miodrag


Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Ugh, they top-posted! :-(
A: Because it is hard to read!
Q: Why top-posting is bad?

You are learning Python, you are suggesting missing features, I feel what majkinetor messages will become very rare in this forum... ;-)
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

I feel what majkinetor messages will become very rare in this forum...

Confirmed.


A: Because it is hard to read!
Q: Why top-posting is bad?

LOL
Posted Image

BoBo
  • Guests
  • Last active:
  • Joined: --
And he's working for the Yugoslavian Gouvernment [email protected].gov.yu

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Yup.

I am programer, system & security analist for Department of the Treasury
Posted Image

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
It seems they implemented my wish but in Pro version. They call it action keys.

More info:
http://www.ranorex.c...cts/ranorexpro/
Posted Image

Futurepower(R)
  • Members
  • 38 posts
  • Last active: Oct 11 2014 11:35 PM
  • Joined: 20 Jun 2005
Try RanorexSpy.exe. Note that, since all Mozilla products use a non-standard way of windowing, Ranorex cannot get the IDs of controls, and so cannot be used with Mozilla products and others like them.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Nor anyhting else designed to be used with native Win controls.

Whats true with Mozzila, is true for IE and Opera too.
Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

Whats true with Mozzila, is true for IE and Opera too.

Not exactly for IE, as you can access the address bar, read the alert() message boxes, and so on.
Anyway, it is true for all portable frameworks drawing their components instead of using Windows' native ones, unless they choose to emulate them, eg. by answering specific messages.
So most Java programs, Gtk+ programs, Rebol ones, and so on, are hard to script: you have to rely on keyboard interface, ImageSearch, and so on.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

Not exactly for IE, as you can access the address bar, read the alert() message boxes, and so on.

You can read AB in Opera too (don't know about Mozzilla)

The fact that you can accutally read 2 or 3 controls doesn't mean anything, but just proves the point.
Posted Image