Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement with recovery scenerio
#11
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi,

I have corrected the code and replaced ExitTest with Exit Do.

The below code basically check if the window is displayed or not, if the window is not displayed it will close all the browsers and open the application again.

Code:
URL = "www.google.com" ' Enter URL of the Application
' Open the Browser and navigate the URL
SystemUtil.Run "IExplorer",URL
' set the initial falg as 0
Flag = 0

Do

If Not Browser("Oracle Applications 11i").Page("Oracle Applications 11i").exist(30) Then
' If the Window is not displayed close all the browsers
SystemUtil.CloseProcessByName "Iexplore.exe"
' Open the Browser and navigate the URL
SystemUtil.Run "IExplorer",URL
Else
' If the Window is displayed then Exit from the loop
Exit Do
End If
' Increment the Flag
Flag = Flag+1
' the below code will exit the test if the flag = 100..
If Flag = 100 Then
ExitTest
End If

Loop


You may replace this code with you existing code. If you are confused, please send your existing code.

Thanks
Vinod[/quote]
Reply
#12
Solved: 10 Years, 8 Months, 4 Weeks ago
I tried putting your code in and I got a Run Error: Invalid procedure call or argument. Line 12: SystemUtil.Run "IExplorer", RFL".

Code:
Browser("Browser").Page("TFSMS Main").Link("TFSMS CAR Requestor").Click
Browser("Browser").Page("Oracle Applications").Link("TFSMS CAR Form").Click

Browser("Oracle Applications 11i").Page("Oracle Applications 11i").Sync
Browser("Browser").Page("Oracle Applications").Sync
wait(30)



URL = "www.google.com" ' Enter URL of the Application
' Open the Browser and navigate the URL
SystemUtil.Run "IExplorer",URL
Flag = 0

Do

    If not OracleFormWindow("TFSMS CAR Process [SCR0080]").exist(30) Then

' If the Window is not displayed close all the browsers
SystemUtil.CloseProcessByName "Iexplore.exe"
' Open the Browser and navigate the URL
SystemUtil.Run "IExplorer",URL
Else
' If the Window is displayed then Exit from the loop
Exit Do
End If
' Increment the Flag
Flag = Flag+1
' the below code will exit the test if the flag = 100..
If Flag = 100 Then
ExitTest
End If

Loop

'Then I have the rest of the script for if the windows do open.

I am also forseeing one last issue once this is resolved. If I close all o fthe windows and start the script over I actually have a login script that runs correctly and first so once all of the windows are closed I would have to go back to the login script not just the beginning of this script. Is that possible?
Reply
#13
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Marie,

Please correct the line 12 of the above script,

Code:
' Open the Browser and navigate the URL
SystemUtil.Run "IExplore.exe",URL

You can call the Login script / action after closing all the browsers(i.e after Line 12) or you can include the login script in a function and call the function after closing all the browsers (i.e after Line 12).

Thanks
Vinod
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  recovery elsekra 0 1,321 12-19-2008, 12:34 AM
Last Post: elsekra

Forum Jump:


Users browsing this thread: 1 Guest(s)