Ranorex

Impossible to click two time with MouseClickElement function

 
Post new topic   Reply to topic    Ranorex Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
BR_05



Joined: 05 Apr 2007
Posts: 11
Location: Switzerland

PostPosted: Fri Sep 14, 2007 9:32 am    Post subject: Impossible to click two time with MouseClickElement function
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
Back to top
View user's profile Send private message
BR_05



Joined: 05 Apr 2007
Posts: 11
Location: Switzerland

PostPosted: Fri Sep 14, 2007 4:04 pm    Post subject: More informations:
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: click into code to enlarge
    #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
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Fri Sep 14, 2007 4:54 pm    Post subject:
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
Back to top
View user's profile Send private message Visit poster's website
BR_05



Joined: 05 Apr 2007
Posts: 11
Location: Switzerland

PostPosted: Fri Sep 14, 2007 5:06 pm    Post subject: Doesn't works
I have tested with the Ranorex.ini file but still the same behaviour.
Sad Sorry.

Do you have an other idea ?

Thanks.

BR
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Fri Sep 14, 2007 5:57 pm    Post subject:
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
Back to top
View user's profile Send private message Visit poster's website
BR_05



Joined: 05 Apr 2007
Posts: 11
Location: Switzerland

PostPosted: Tue Sep 18, 2007 9:39 am    Post subject: Thanks
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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> Bug Reports All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum