Impossible to click two time with MouseClickElement function

Bug reports.
BR_05
Posts: 11
Joined: Thu Apr 05, 2007 8:04 am
Location: Switzerland

Impossible to click two time with MouseClickElement function

Post by BR_05 » Fri Sep 14, 2007 8:32 am

I use the function MouseClickElement to click on element.
I have a application in javascript but when I invoke the function MouseClickElement a second time on the same element, the function return an error code: 1 but the element was found with success with the function ElementFindChild before.

I have tested with the Ranorex Recorder and the Recorder have the same problem.

Just one things about the GUI under test: It's an application using javascript and the classname is "Internet Explorer_Server". This application works like an installer with several step to configure, but the windows still the same and button "Next" (for example) still the same. In fact, I'm not able to click on the "Next" button several time. (but Ranorex Recorder is not able too).

Thanks in advance

BR_05
Posts: 11
Joined: Thu Apr 05, 2007 8:04 am
Location: Switzerland

More informations:

Post by BR_05 » Fri Sep 14, 2007 3:04 pm

I don't understand well !

The function MouseClickElement is able to click on my element if I quit the script and restart the script.

More information:

I have a window (in javascript) with the script I execute the following command (python2.4, Ranorex 1.2 Pro):

Code: Select all

    #Get the handle of the specified window
    form = Ranorex.FormFindTitle(WindowTitle)
    
    if form == 0:
        print "Failed | Windows with title : " + WindowTitle + " was not found"
        sys.exit()

    # Get element in form    
    element = Ranorex.ControlGetElement(form)

    if element == 0:
        print "Failed | no element found in " + WindowTitle
        sys.exit()

    # Find the element with the specified ElementName        
    ElementFound = Ranorex.ElementFindChild(element, RoleName, ElementName)
    print ElementFound
    
    if ElementFound[2] == ElementName :
        if Ranorex.MouseClickElement(ElementFound) == 0:
            print "Click with success on element : '" + ElementName + "' in window : '" + WindowTitle + "'"
        else:
            print " ===> Not able to click on element : '" + ElementName + "' in window : '" + WindowTitle + "'"
if I call this code two time in the same script (two click on the same element) the function
MouseClickElement return 1 at the second time.

But if I execute this code only one time and quit the script and restart the script the function MouseClickElement works fine.

Like if the function MouseClickElement is not reset or something like that.

Thanks in advance for your help.

BR

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Fri Sep 14, 2007 3:54 pm

Please try the following:

1. Generate a textfile with the name Ranorex.ini
2. Insert the text:

[General]
ElementCacheSize=4

3. Copy the file into the Ranorex Bin directory (RanorexCore.dll must be in the same directory).

If this works, than we have a bug in the element cache functionality.

Jenö
Ranorex Team

BR_05
Posts: 11
Joined: Thu Apr 05, 2007 8:04 am
Location: Switzerland

Doesn't works

Post by BR_05 » Fri Sep 14, 2007 4:06 pm

I have tested with the Ranorex.ini file but still the same behaviour.
:( Sorry.

Do you have an other idea ?

Thanks.

BR

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Fri Sep 14, 2007 4:57 pm

I think you can make only a workaround at the moment:

Read and save the position (ElementGetPosition) of the element at the first time and use the function MouseMoveClick() at the second time.

Hope this works.

Jenö
Ranorex Team

BR_05
Posts: 11
Joined: Thu Apr 05, 2007 8:04 am
Location: Switzerland

Thanks

Post by BR_05 » Tue Sep 18, 2007 8:39 am

Thank you for help and your quick answer.

I will try with your work around and I inform you if I discover something about this problem.

Best Regards