hi frds ...i have figured to solve my issue...If we goto Tools-->Object Identification-->Environment--->Standard Windows-->Window Object (in Test Object classes)-->Mandatory Propertied--->Add/Remove--->Check Visible Property..If I record in QTP after doing this am able to identify the window and able to complete my script.
Still I have 2 issues in my script pls help me in this.I have attached my code below.
Issue 1 : If it goes into the below If condtion (on right click of a image in webtable),a window opens ,but its not moving to next line of the code until i click on some blank space in the apllication.If I click on any blank space of the application everthing is fine its moving to next loop and goes on until i face same situation again.
Need solution for this.
Code:
If Window("Window_2").WinMenu("ContextMenu").Exist Then
Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebElement("html id:=mainprogramContainer").Click
index_count = index_count + 5
else
Code:
Dim index_count
Dim b
DataTable.AddSheet "Updated_By"
Datatable.GetSheet ("Updated_By").AddParameter "Sno"," "
Datatable.GetSheet ("Updated_By").AddParameter "Last_Name"," "
Datatable.GetSheet ("Updated_By").AddParameter "First_Name"," "
Datatable.GetSheet ("Updated_By").AddParameter "ID"," "
Datatable.GetSheet ("Updated_By").AddParameter "App_Name"," "
rws =Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").GetROProperty("rows")
cols =Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").GetROProperty("cols")
index_count = 4
b = 1
rCount=Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").GetROProperty("rows")
For r=2 to rCount
cCount=Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").ColumnCount(r)
For c=2 to cCount
index_count = index_count
b = b
Set obj=Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebTable("name:=Previous Week").Image("image type:=Plain Image","index:="& index_count)
obj.Highlight
Setting.WebPackage("ReplayType") = 2
obj.RightClick
Setting.WebPackage("ReplayType") = 1
[b]If Window("Window_2").WinMenu("ContextMenu").Exist Then
index_count = index_count + 5
else [/b]
Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").Link("name:=View app metadata").Click
updated_By = cstr (Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebElement("html id:=popUpViewMetaData").GetROProperty("innertext"))
sarray = Split (updated_By," ")
last_name = sarray(7)
first_name = sarray(8)
id = sarray(9)
Datatable.GetSheet("Updated_By").SetCurrentRow b
Datatable.value("Last_Name","Updated_By") = last_name
Datatable.value("First_Name","Updated_By") = first_Name
Datatable.value ("ID","Updated_By") = id
Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebElement("innertext:=View app metadataclose").Link("name:=close").Click
index_count = index_count + 5
b = b+1
End If
Next
Next
Issue 2 : If it goes into the below else If condtion (on right click of a image in webtable),a window opens ,but i have to for some 15 or 20 sec for qtp to execute next line.
Can any one tell me how reduce this time or any other solution.
Code:
If Window("Window_2").WinMenu("ContextMenu").Exist Then
Browser("name:=Scheduling Week Calendar.*").Page("title:=Scheduling Week Calendar*").WebElement("html id:=mainprogramContainer").Click
index_count = index_count + 5
else