how to handle "Launch Application" pop up window in firefox using autoIT - autoit

I am testing a webpage (in firefox browser) using selenium where there is a scenario which opens windows pop-up which I need to control(handle) using AutoIT.
I have tried the following code but it did not work.
WinWaitActive("Launch Application","Launch Application",10)
ControlCommand("Launch Application", "Launch Application","","Check")
ControlClick("Launch Application","Launch Application","","left")
How do I do the following using the autoIT
Tick the checkbox "Remember my choice for xauthorforexcel links"
Click on the "Open Link" button
OR
Click on the "Cancel" Button.
AutoIT Window Info is as follows:
>>>> Window <<<<
Title: Launch Application
Class: MozillaDialogClass
Position: 476, 317
Size: 328, 350
Style: 0x16CC0084
ExStyle: 0x00000101
Handle: 0x00000000001409A6
>>>> Control <<<<
Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID:
Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:
>>>> Mouse <<<<
Position: 731, 632
Cursor ID: 0
Color: 0x85B3DF
>>>> StatusBar <<<<
>>>> ToolsBar <<<<
>>>> Visible Text <<<<
>>>> Hidden Text <<<<

You are looking for a window with both Title and Text as "Launch Application" but the window only has that for the Title. Change the WinWaitActive() to
WinWaitActive("Launch Application", "",10)
If that doesn't help, it is possible the window is not active. If so, use:
Local $hWnd = WinWait("Launch Application","",10)
WinActivate($hWnd)

Related

qml dialog removing ok button

I want to create a custom dialog in qml without the ok button.
this is my code :
Dialog {
id: DialogId
title: appName
}
when the dialog is opened there is an Ok button.
I'm using QtQuick.Dialogs 1.2
The property standardButtons controls wich buttons are in your dialog.
The default value is StandardButton.Ok
If you don't whant any button you need to re-implement contentItem
For instance:
contentItem: Rectangle {
color: "lightskyblue"
implicitWidth: 400
implicitHeight: 100
Text {
text: "Hello blue sky!"
color: "navy"
anchors.centerIn: parent
}
}

DropDown menu with QtQuickControls2 on Qt application

on qt quick controls 2, how can I configure a button Item with a dropdown menu of others buttons. When the user click on this button is triggered onClicked signal and under the button should be open a dropdown menu with other buttons. I have try with ButtonGroup but I don't know if this is the best practice. There is some Controls2 item to be use? Thanks in advice
Best Regards
Daniele
There is Menu from QtQuick.Controls 2.0 that can do what you want.
Example taken from the documentation :
Button {
id: fileButton
text: "File"
onClicked: menu.open()
Menu {
id: menu
y: fileButton.height
MenuItem {
text: "New..."
}
MenuItem {
text: "Open..."
}
MenuItem {
text: "Save"
}
}
}

What is button property "tooltip" used for?

I'm writing a test application to try out what QML has to offer. I have created a simple button and tried to create a tooltip on mouse hover event. I found several solutions already how to make that happen (example) and it is not a problem.
In the documentation, however, I have encountered a button property called tooltip. Now I assumed if a built-in component has such a property then creation of tooltip is automated. Apparently that is not the case, since defining tooltip property did not change anything.
The question is what is this property actually used for?
Button {
id: myButton
x: 10
y: 10
text: "Click me"
tooltip: "Some tooltip"
}
Showing of tooltip requires receiving of mouse hover events and this is possible only if your button is not overlapped with some another MouseArea with hoverEnabled property equal to true. Following example shows tooltip fine on OS X and Qt 5.2.1:
import QtQuick 2.0
import QtQuick.Controls 1.1
Rectangle {
width: 360
height: 360
Text {
anchors.centerIn: parent
text: "Hello World"
}
Button {
id: myButton
x: 10
y: 10
text: "Click me"
tooltip: "Some tooltip"
}
}

Read text of a control that is not shown under Visible Text using AutoIt Window Info tool

I have a window inside which I have a Control. I can read the Class and Instance of this control using AutoIt Window Info Tool, but the Visible Text column does not display the text that is visible inside this control. Hence, I am not able to read the text using ControlGetText Function. Is there any other way to read this text? All I want to do is read the text that is being displayed under this control.
This is the info that I am getting in AutoIt Window Info. I can see a text "Sample text" in the control, but it's not available in the Visible Text tab
>>>> Window <<<<
Title: Documents
Class: CabinetWClass
Position: 80, 77
Size: 1355, 744
Style: 0x14CF0000
ExStyle: 0x00000100
Handle: 0x0000000000310B4A
>>>> Control <<<<
Class: Internet Explorer_Server
Instance: 1
ClassnameNN: Internet Explorer_Server1
Name:
Advanced (Class): [CLASS:Internet Explorer_Server; INSTANCE:1]
ID:
Text:
Position: 794, 87
Size: 545, 566
ControlClick Coords: 255, 174
Style: 0x56000000
ExStyle: 0x00000000
Handle: 0x0000000000BA08A2
>>>> Mouse <<<<
Position: 1137, 368
Cursor ID: 0
Color: 0xFFFFFF
>>>> StatusBar <<<<
1:
>>>> ToolsBar <<<<
>>>> Visible Text <<<<
Address: C:\Users\some\path
Documents
Shell Preview Extension Host
Namespace Tree Control
Tree View
ShellView
>>>> Hidden Text <<<<
Namespace Tree Control
The control you are accessing is embed object instance of Internet Explorer.
In order to attach to it, you can use _IEAttach using the mode "embedded".
; Attach to a browser control embedded in another window
#include <IE.au3>
Local $oIE = _IEAttach("A Window Title", "embedded")
Local $sText = _IEBodyReadText($oIE)
MsgBox(0, "Body Text", $sText)

Set control text in AutoIt with out window text and title

I am quite newbie to autoit. I have 2 questions.
How to use ControlFocus ( "", "", "[X:643;Y:339]" ) when widow has no text and no title.Please look at following information of window and control viewed by window informer.
Window <<<<
Title:
Class: WindowsForms10.Window.8.app.0.33c0d9d
Position: 0, 0
Size: 1024, 768
Style: 0x16010000
ExStyle: 0x00010000
Handle: 0x005201E0
Control <<<<
Class: WindowsForms10.EDIT.app.0.33c0d9d
Instance: 2
ClassnameNN: WindowsForms10.EDIT.app.0.33c0d9d2
Name: txtConsumerNo
Advanced (Class): [NAME:txtConsumerNo]
ID: 15270262
Text:
Position: 638, 237
Size: 263, 30
ControlClick Coords: 38, 27
Style: 0x560100C0
ExStyle: 0x00000200
Handle: 0x00E90176
How is it possible to interact with this control?
I want to call text change event of a this control. How is it possible
If you are dealing with a window without text and a title, it may be easier to first get the handle to the window with WinGetHandle. You can get the handle from the active window like so:
$hWnd = WinGetHandle("[ACTIVE]")
For interacting with the control you have a lot of options. Your best option is probably to use the Name of the control, which is: txtConsumerNo. If you then use ControlFocus like so it will work. Note that $hWnd comes from the above WinGetHandle statement.
ControlFocus($hWnd, "", "[NAME:txtConsumerNo]")
I recommend against using the X and Y position of the control. It can have a hard time finding the correct control. When other methods are available, such as the name or the class, those are very much preferred.
You can change the text of another control in AutoIt with the ControlSetText method. It will call the 'text change event' for you automatically. See the help file for the documentation about ControlSetText. It works in a similar way to ControlFocus.

Resources