09-04-2012, 01:03 PM
For below script, I was using wait (3) to view the operations mentioned in script.. But due to wait command, I need to face 3 secs unnecessary delay..
I though .Sync can solve my purpose of waiting to complete current navigation and then only moving ahead.. But when I use .Sync in below script, It is not waiting to load the mentioned page and it goes ahead, which is wrong. Please review below script.
----------------
--------------
Here with above script, though step of scheduler accessing is NOT yet started / completed, next step of accessing patient search is started.. I was expecting that .Sync will help me to load scheduler page first.
Can anyone please let me know that what is wrong here.
If .Sync can solve my problem then I want to replace it with Wait to avoid unnecessary delay.
I though .Sync can solve my purpose of waiting to complete current navigation and then only moving ahead.. But when I use .Sync in below script, It is not waiting to load the mentioned page and it goes ahead, which is wrong. Please review below script.
----------------
Code:
DataTable.Import("D:\Book1.xls")
For i=1 to Datatable.GetRowCount
DataTable.SetCurrentRow i
SystemUtil.Run DataTable("URL",dtGlobalSheet)
Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtUsername").Set DataTable("Username",dtGlobalSheet)
Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtPassword").Set DataTable("Password",dtGlobalSheet)
Browser("InSync :: Login").Page("InSync :: Login").WebButton("Login").Click
Browser("InSync :: Login").Page("InSync :: Login_2").WebList("ddlUsers").Select DataTable("User",dtGlobalSheet)
'Select facility'
If Browser("InSync :: Login").Page("InSync :: Login_2").WebButton("Ok").Exist Then
Browser("InSync :: Login").Page("InSync :: Login_2").WebButton("Ok").Click
Wait (2)
Else
Reporter.ReportEvent micPass, "Login page", "Facility not exist"
Wait (2)
End If
'Access Scheduler
Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image2").Click
[color=#FF0000]Browser("InSync :: Login").Page("InSync :: Visit Scheduler").Sync[/color]
'Access Patient Search
Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image3").Click
Browser("InSync :: Login").Page("InSync :: Patient Search").Image("Edit Patient").Click
--------------
Here with above script, though step of scheduler accessing is NOT yet started / completed, next step of accessing patient search is started.. I was expecting that .Sync will help me to load scheduler page first.
Can anyone please let me know that what is wrong here.
If .Sync can solve my problem then I want to replace it with Wait to avoid unnecessary delay.