Jump to content
iamtech

Winwait and Controlclick not working on Internet explorer's Pop up box

Recommended Posts

iamtech
Posted (edited)

My code is : 

WinWait ("Windows Internet Explorer")
WinActivate ("Windows Internet Explorer")
ControlClick ("Windows Internet Explorer", "&Retry", "[CLASS:Button; INSTANCE:1]", "left", 1)

But, it was not working.

Autoit windows info :

>>>> Window <<<<
Title:  Windows Internet Explorer
Class:  #32770
Position:   469, 279
Size:   445, 229
Style:  0x94C801C5
ExStyle:    0x00010101
Handle: 0x00000000016008BC

>>>> Control <<<<
Class:  
Instance:   
ClassnameNN:    
Name:   
Advanced (Class):   
ID: 
Text:   
Position:   
Size:   
ControlClick Coords:    
Style:  
ExStyle:    
Handle: 

>>>> Mouse <<<<
Position:   646, 468
Cursor ID:  0
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
&Retry
Cancel
To display the webpage again, the web browser needs to
resend the information you've previously submitted.

If you were making a purchase, you should click Cancel to
avoid a duplicate transaction. Otherwise, click Retry to display
the webpage again.


>>>> Hidden Text <<<<

 

Capture.JPG

Edited by iamtech

Share this post


Link to post
Share on other sites
Earthshine
Posted (edited)

look in the help file for the IE functions specifically to automate IE

It's near the bottom of the folder list in the help file, under User Defined Functions->IE Management 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
iamtech
13 hours ago, Earthshine said:

look in the help file for the IE functions specifically to automate IE

It's near the bottom of the folder list in the help file, under User Defined Functions->IE Management 

@Earthshine there are no option about the IE pop up box

Share this post


Link to post
Share on other sites
junkew

Whats your definition of "not working" does script come to an end or is it "waiting" for the popup to go away.

Its important to know what you do before you start waiting for your popup. If you called a javascript (in)directly that triggers the popup autoit will wait till your js is finished so you have some kind of deadlock.

1. Use a 2nd script to click away modal dialogs

2. Do not call a blocking JS script but send a "normal" mouseclick that doesn't cause the deadlock

3. Check for adlib register function

option 1 will allways work whereas for 2 & 3 its not allways possible

Share this post


Link to post
Share on other sites
iamtech
1 hour ago, junkew said:

Whats your definition of "not working" does script come to an end or is it "waiting" for the popup to go away.

Its important to know what you do before you start waiting for your popup. If you called a javascript (in)directly that triggers the popup autoit will wait till your js is finished so you have some kind of deadlock.

1. Use a 2nd script to click away modal dialogs

2. Do not call a blocking JS script but send a "normal" mouseclick that doesn't cause the deadlock

3. Check for adlib register function

option 1 will allways work whereas for 2 & 3 its not allways possible

@junkew My Full code is :

#include <IE.au3>
_IELoadWait($oIE)
_IENavigate($oIE, "my website")
$consent = _IEGetObjById($oIE,"consent")
_IEAction($consent,"click")
_IELoadWait($oIE)

$imgcio = _IEGetObjById($oIE,"imgcio")
_IEAction($imgcio,"click")

For $i = 1 to 6
 _IEAction($oIE,"refresh")
 WinWait ("Windows Internet Explorer")
 WinActivate ("Windows Internet Explorer")
ControlClick ("Windows Internet Explorer", "&Retry", "[CLASS:Button; INSTANCE:1]", "left", 1)
_IELoadWait($oIE)
$imgcio = _IEGetObjById($oIE,"imgcio")
_IEAction($imgcio,"click")

Next

imgcio is the js button and i want to re-send the information.

Share this post


Link to post
Share on other sites
junkew

your code blocks due to that you call the event click which most likely has a blocking dialog triggered by the JS script 

_IEAction($imgcio,"click")

see https://www.autoitscript.com/autoit3/docs/libfunctions/_IEPropertyGet.htm 2nd example on how to get the dimensions of your element and move the mouse to that element.

Small step for you to make mousemove a mouseclick

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×