Jump to content

How to automate clicking icon and unput username and password using AUTOIT in Robot Framework?


Naveen1234
 Share

Recommended Posts

I need to automate the following scenario :

STEP 1. Launch airtel application by clicking airtel icon available in Desktop
STEP 2. Then Input "Username" and "Password" in opened screen
STEP 3. Then click on "connect" button

I am able to do the first step using the following script:

*** Settings ***
Library         AutoItLibrary

*** Variables ***
${airtel}       C:\\Program Files\\airtel\\airtel.exe

*** Test Cases ***
Example
    Run             ${airtel}
    Mouse Click     strButton=LEFT, nX=369, nY=489, nClicks=2, nSpeed=-1

I am using "Au3Info" tool, to get mouse position.

Can anyone please tell me how to do the STEP 2 and STEP 3?

Thanks in advance.

 

Link to comment
Share on other sites

Welcome to Autoit and the forum!

Please have a look at ControlSend and ControlClick in the help file.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thanks for your reply.

I have modified as shown below:

*** Settings ***
Library            AutoItLibrary

*** Variables ***
${airtel}        C:Program Filesairtelairtel.exe

*** Test Cases ***
Example
    Run                        ${airtel}
    Control Send            strTitle=airtel, strText=FolderView, strControl=1, strSendText=test,nMode=0
    Control Click            strTitle=airtel, strText=FolderView, strControl=1, strButton=LEFT, nNumClicks=1, nX=1228, nY=601

 

But I am getting error as shown below:

 

com_error: (-2147352561, 'Parameter not optional.', None, None)

 

Please suggest me how to fix this.

Edited by Naveen1234
Link to comment
Share on other sites

I'm not familiar with the framework you use and how it interacts with AutoIt.

I would try to remove the parameter names and the space in "Control Send". Example:

ControlSend "airtel", "FolderView", 1, "test", 0

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

If You're using AutoItx in this framework, then I think there are no optional parameters in any call.

Since your Control* functions appear to have the correct amount, I'd have to assume that Run function is the culprit here.

Something like ...

Run                        strFilename=C:Program Filesairtelairtel.exe, strWorkingdir= C:Program Filesairtel, intFlag=1

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Certainly, just as soon as you post the window info summary tab info of both the username and password controls on the window and the button you want to click.

Provide all info from the summary tab for all three controls, and the native code is simple, without it, it's impossible.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Please find below the Summary Tab info for "Email", "Password" and "PLAY" button.

   

I want to do the following through Autoit Script:

STEP 1 - Enter Email ID :  test@gmail.com

STEP 2 - Enter Password : test@123

STEP 3 - Press "PLAY" button.

   

Email Field Summary:
====================

>>>> Window <<<<
Title:    QUAKE LIVE Launcher
Class:    WindowsForms10.Window.8.app.0.33c0d9d
Position:    308, 105
Size:    750, 517
Style:    0x16010000
ExStyle:    0x00050000
Handle:    0x00030362

>>>> Control <<<<
Class:    WindowsForms10.EDIT.app.0.33c0d9d
Instance:    1
ClassnameNN:    WindowsForms10.EDIT.app.0.33c0d9d1
Name:    f_email
Advanced (Class):    [NAME:f_email]
ID:    328436
Text:    
Position:    78, 462
Size:    150, 20
ControlClick Coords:    44, 11
Style:    0x560100C0
ExStyle:    0x00000200
Handle:    0x000502F4

>>>> Mouse <<<<
Position:    430, 578
Cursor ID:    0
Color:    0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
12/23
Support Holiday Break
12/18
Holiday Content Online
12/10
Update 22 Follow-up
12/08
Quake Live Non-recurring Subscription...
QUAKE LIVE is Online.
Latest News
Server Status
Remember Me
Email:
Password:


>>>> Hidden Text <<<<

***********************************************************************************

Password Field Summary:
=======================


>>>> Window <<<<
Title:    QUAKE LIVE Launcher
Class:    WindowsForms10.Window.8.app.0.33c0d9d
Position:    308, 105
Size:    750, 517
Style:    0x16010000
ExStyle:    0x00050000
Handle:    0x00030362

>>>> Control <<<<
Class:    WindowsForms10.EDIT.app.0.33c0d9d
Instance:    2
ClassnameNN:    WindowsForms10.EDIT.app.0.33c0d9d2
Name:    f_password
Advanced (Class):    [NAME:f_password]
ID:    197398
Text:    
Position:    343, 462
Size:    150, 20
ControlClick Coords:    73, 10
Style:    0x560100E0
ExStyle:    0x00000200
Handle:    0x00030316

>>>> Mouse <<<<
Position:    724, 577
Cursor ID:    0
Color:    0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
12/23
Support Holiday Break
12/18
Holiday Content Online
12/10
Update 22 Follow-up
12/08
Quake Live Non-recurring Subscription...
QUAKE LIVE is Online.
Latest News
Server Status
Remember Me
Email:
Password:


>>>> Hidden Text <<<<


***********************************************************************************

PLAY Button summary:
====================

>>>> Window <<<<
Title:    QUAKE LIVE Launcher
Class:    WindowsForms10.Window.8.app.0.33c0d9d
Position:    308, 105
Size:    750, 517
Style:    0x16010000
ExStyle:    0x00050000
Handle:    0x00030362

>>>> Control <<<<
Class:    WindowsForms10.Window.8.app.0.33c0d9d
Instance:    1
ClassnameNN:    WindowsForms10.Window.8.app.0.33c0d9d1
Name:    f_login
Advanced (Class):    [NAME:f_login]
ID:    197476
Text:    
Position:    660, 427
Size:    87, 88
ControlClick Coords:    48, 34
Style:    0x56000000
ExStyle:    0x00000000
Handle:    0x00030364

>>>> Mouse <<<<
Position:    1016, 566
Cursor ID:    0
Color:    0x7E0605

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
12/23
Support Holiday Break
12/18
Holiday Content Online
12/10
Update 22 Follow-up
12/08
Quake Live Non-recurring Subscription...
QUAKE LIVE is Online.
Latest News
Server Status
Remember Me
Email:
Password:


>>>> Hidden Text <<<<
Please help me write a autoit script for these things.

Thanks for your help.

Edited by Melba23
Added tags
Link to comment
Share on other sites

  • Moderators

Naveen1234,

 

QUAKE LIVE Launcher

You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game launching - before you post again. Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...