Sign in to follow this  
Followers 0
jaideept

IE script error dialog Yes button

2 posts in this topic

hello everyone,

i am getting one IE script error dialog in which i need to click on Yes button. although i can simply close this window but my requirement is to click Yes button.

title of the window: "Internet Explorer Script Error"

content of the window: "Do you want to continue running scripts on this page?"

i have found one good example which i have modified as per my need as shown below:

Global $foundOne

Global $sleepVal

$sleepVal = 1000

;loop

While 1

process_window_if_it_exists("Internet Explorer Script Error", "The webpage you are viewing is trying to close the window.","&Yes")

if $foundOne < 10 Then

$sleepVal = 100

$foundOne = $foundOne + 1

Else

$foundOne = 11

$sleepVal = 5000 ;5 seconds

EndIf

sleep($sleepVal)

wend

func process_window_if_it_exists($winTitle, $checkMsg, $buttonName)

if WinExists($winTitle,"") Then

MsgBox(0, "", "title is: " & $winTitle)

;if StringLeft(ControlGetText($winTitle,"","Static2"),StringLen($checkMsg)) = $checkMsg then

ControlClick($winTitle,'',$buttonName)

;ControlClick("[TITLE:Internet Explorer Script Error;CLASS:#32770]", "Yes", "[CLASS:Button; TEXT:Yes; INSTANCE:1]")

controlclick("Do you want to continue running scripts on this page?", "&Yes", 6)

;Send("This is text!y")

;endif

sleep(100)

$foundOne = 1

EndIf

endfunc

this is not working,please suggest.

Thanks,

Jaideep

Share this post


Link to post
Share on other sites



Hi jaideept,

You need to step through this program outputting your variables and return values along the way (consolewrite or msgbox). It will be obvious where the problem is once you know what's happening in your script.

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
Sign in to follow this  
Followers 0