1
votes

What is the syntax of "Control Click" Keyword to click an button on a window.

I am trying to automate the windows app. I need to do the following steps (STEP 1,2 and 3 are working. I am having issue in STEP 4):

STEP 1: Start a app using batch file

STEP 2: Click a "Next >" button using coordinates with the "Mouse Click" keyword.

STEP 3: Click a text box and input some text.

STEP 4: I need to click a "Next >" button. I tried using "Mouse Click" that I used in STEP 2. But it is not working.

So I am planning to use "Control Click" keyword as shown below. But I am getting "com_error: (-2147352561, 'Parameter not optional.', None, None)" error.

Robot file:

***Settings***

Library     AutoItLibrary
Library     Collections
Library     String


*** Variables ***

${Run_batchfile}        C:\\Users\\test\\Desktop\\software_install.bat
${Title}                Setup - test software



***Test Cases***


testcase1
    Run                 ${Run_batchfile}
    Wait For Active Window      ${Title}        TimeOut=140
    Mouse Click         strButton=LEFT, nX=887, nY=523, nClicks=2, nSpeed=1000
    Mouse Click         strButton=LEFT, nX=456, nY=225, nClicks=1, nSpeed=-1
    Wait For Active Window      ${Title}
    Send                strSendText=, c:\\test_te

    Control Click       strTitle=${Title}, strText=${Title}, strControl=1, strButton=Next >, nNumClicks=2, nX=888, nY=524

Run time logs:

C:\Users\test\Desktop\RFW with AutoIt>pybot auto.robot
==============================================================================
Auto
==============================================================================
testcase1                                                             .
C:\Users\test\Desktop\RFW with AutoIt>echo off
testcase1                                                             | FAIL |
com_error: (-2147352561, 'Parameter not optional.', None, None)
------------------------------------------------------------------------------
Auto                                                                  | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  C:\Users\test\Desktop\RFW with AutoIt\output.xml
Log:     C:\Users\test\Desktop\RFW with AutoIt\log.html
Report:  C:\Users\test\Desktop\RFW with AutoIt\report.html

C:\Users\test\Desktop\RFW with AutoIt>

Could anyone please tell me, How to use "Control Click" keyword to click a button in a windows's screen?

Thanks, Kumar.

4
May be you wanted to check this link from robotframework-user list group groups.google.com/forum/#!searchin/robotframework-users/… (may be you need to login into gmail account if it is not working for you to view this topic) - Rao

4 Answers

0
votes
Control Click  ${title}  ${EMPTY}  [CLASS:Button;TEXT:Next >]

It seems that the parameter names are documentation only.

Without the controlID (third parameter) youre getting the previous error.

0
votes

The way you used control click is wrong I think. You should have at least separated the arguments with at least two (2) spaces, not with ", ". So, this would be:

Control Click strTitle=${Title} strText=${Title} strControl=1 strButton=Next > nNumClicks=2 nX=888 nY=524

In my code, I used four (4) spaces, which what Robot Framework recommends.

0
votes

Hi have tried many many things before I was able to get it work using the back slash "\" as separator without any attributes or titles just proving the button name (ClassnameNN value) from "AutoIt V3 Window info":

 Control Click       \    \   Button1
-1
votes

I think just Remove the Arguments name from your code ie. strButton=,strTitle=,nX=, nY=,nClicks= In RF only need to put like this...

testcase1
Run                 ${Run_batchfile}
Wait For Active Window      ${Title}        TimeOut=140 
Mouse Click    LEFT    887    523    2    1000