Hello All,
I am running an AHK script to fill up certain field in a webform using COM elements.
But a certain pop up when I click a checkbox is freezing the script. And the script only resumes when I close the pop up manually.
No code in the script is being executed once the pop up opens.
Please help, If any one has some idea why this might be happening.
Thanks in advance.
AHK Script freezing due to pop up. Topic is solved
Re: AHK Script freezing due to pop up. Topic is solved
Modal popups can potentially interrupt normal script behavior but it's hard to say without seeing your code, how exactly you are approaching this and or being able to test it directly.kaosway07 wrote:..a certain pop up when I click a checkbox is freezing the script. And the script only resumes when I close the pop up manually...
Can you post your code so far? It shouldn't be too difficult to close and or manipulate the popup once it's inspected.
Re: AHK Script freezing due to pop up.
Hi. Thanks for the reply.
The code is
please place your code in [code][/code] tags!
Now once thar Mail Radio button is cliked. The script freezes. And I have to manually close the pop up and script again resumes from the next line.
Let me know if you need any other information. Help is appreciated.
Thank You
The code is
Code: Select all
wb := WBGet()
wb.visible := True
Framex := wb.document.parentwindow.frames["Main"].document
Framex.getElementById("mail_radio").click()
Sleep, 1000
Send, {ENTER}
Sleep 1000
Framex.getElementById("Submit").click()
return
Now once thar Mail Radio button is cliked. The script freezes. And I have to manually close the pop up and script again resumes from the next line.
Let me know if you need any other information. Help is appreciated.
Thank You
Re: AHK Script freezing due to pop up.
If it's a modal alert it like this:
It can be closed like any other standard dialog box.
For instance:
If it's a DOM based dialog box create a reference to it and then use the close() method:
htms
It can be closed like any other standard dialog box.
For instance:
Code: Select all
WinWait Message from webpage
ControlClick, Button1, Message from webpage
Code: Select all
alertBox := wb.document.getElementById("myDialog")
alertBox.close()
Re: AHK Script freezing due to pop up.
Thank you so much for your help. However my issue was not with script but the checkbox. The scipt always froze after checkbox elements was clicked, so no matter what ever I added after that was not executed by ahk hence the pop up was not closed.
However I tweaked the script to set focus on the checkbox and checked by sending a space key. Later I closed the pop up by using the controlclick like you recommended.
I wonder what went wrong when I used click() function. Is there any other way to check a checkbox other then clicking it. May come in handy in future.
Thank You very much.
However I tweaked the script to set focus on the checkbox and checked by sending a space key. Later I closed the pop up by using the controlclick like you recommended.
I wonder what went wrong when I used click() function. Is there any other way to check a checkbox other then clicking it. May come in handy in future.
Thank You very much.
Who is online
Users browsing this forum: No registered users and 122 guests