Code:
' First opening the IE browser and do some work in Admin page
IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate(DataTable("URL", dtGlobalSheet) & "Administration/")
Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Set(DataTable("NTUserName", dtGlobalSheet))
Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Type(micTab)
Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Set(DataTable("NTPassword", dtGlobalSheet))
Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Type(micTab)
Browser("Browser_3").Dialog("Connect to Website").WinCheckBox("Remember my password").Set(DataTable("RememberNTPassword", dtGlobalSheet))
Browser("Browser_3").Dialog("Connect to Website").WinButton("OK").Click()
Browser("Administration").Page("Administration_Index").WebList("ctl00$Child1$FIRST_NAME").Select(DataTable("AdminFirstName", dtGlobalSheet))
Browser("Administration").Page("Administration_Index").WebList("ctl00$Child1$LAST_NAME").Select(DataTable("AdminLastName", dtGlobalSheet))
Browser("Administration").Page("Administration_Index").WebEdit("ctl00$Child1$PASSWORD").Set(DataTable("AdminPassword", dtGlobalSheet))
Browser("Administration").Page("Administration_Index").WebButton("Login").Click()
Browser("Administration").Page("Administration_Index_01").Link("Add UserTest Folder/Group").Click()
Browser("Administration").Page("Administration_AddUserTest").WebButton("Add UserTest Folder\Group").Click()
Browser("Administration").Page("Administration_AddUserTest_02").WebButton("Add DocumentRepository").Click()
Browser("Administration").Page("Administration_AddUserTest_03").WebButton("Create Product Folders").Click()
Browser("Administration").Page("Administration_Index_03").Sync()
'After doing this work closing the IE browser.
SystemUtil.CloseProcessByName("IEXPLORE.EXE")
IE = Nothing
' Here i am applying the two loops , 1st is for number of members within database, 2nd is for number of groups within database.
' that means each and every user iterate with each and every group within database.
' there are total 60 users and 60 groups in the datase, means this sript will open the browser 60*60 times.
' but currently this will iterate for only 4 users , that means 4*60=240 . after this browser hangs and we could not run the script agian
'So to run for remaning user , i have to delete first 4 users from database and again i have to open the script and run it.
For Member_row_number = 1 To Number_of_Members
sQuery2 = "select WG_NAME from WorkgroupMembers where (FIRST_NAME= '" & Member.Item("FIRST_NAME" & Member_row_number) & "' AND LAST_NAME = '" & Member.Item("LAST_NAME" & Member_row_number) & "' AND UPDATE_STATUS = 'Subscribed') "
SubscribedWorkGroup = CreateObject("Scripting.Dictionary")
Number_of_SubscribedWorkGroup = GetData(sQuery2, SubscribedWorkGroup)
For row_number = 1 To Number_of_Groups
strSubscribed = False
For SubscribedWorkGrouprow_number = 1 To Number_of_SubscribedWorkGroup
If WorkGroup.Item("WG_NAME" & row_number) = SubscribedWorkGroup.Item("WG_NAME" & SubscribedWorkGrouprow_number) Then
strSubscribed = True
Exit For
End If
Next
' Agian open the browser and check for user rights using page.
IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate(DataTable("URL", dtGlobalSheet) & "Documents/" & WorkGroup.Item("WG_NAME" & row_number) & "/Test.txt")
Browser("Browser_3").Dialog("Connect to Website").Activate()
Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Set(DataTable("Domain", dtGlobalSheet) & "\" & Member.Item("FIRST_NAME" & Member_row_number) & "." & Member.Item("LAST_NAME" & Member_row_number))
Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Type(micTab)
Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Set(Member.Item("USER_PASSWORD" & Member_row_number))
Browser("Browser_3").Dialog("Connect to Website").WinCheckBox("Remember my password").Set("ON")
Browser("Browser_3").Dialog("Connect to Website").WinButton("OK").Click()
'Doing something
''''''''
''''''''
''''''''
'Writing into report depending upoun the doing something
'Close browser.
SystemUtil.CloseProcessByName("IEXPLORE.EXE")
IE = Nothing
Webutil.DeleteCookies()
Next
SubscribedWorkGroup = Nothing
Next
Script.txt (Size: 5.04 KB / Downloads: 101)