Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Script for the below scenario which will solve my actual issue
#4
Solved: 11 Years, 6 Months, 2 Weeks ago
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
Reply


Messages In This Thread
RE: Need Script for the below scenario which will solve my actual issue - by RameshKrishnan - 07-11-2013, 03:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create Video of a scenario shivangshah 0 1,289 01-30-2017, 07:45 PM
Last Post: shivangshah
  Default recovery scenario TurtleRock 1 3,003 05-30-2014, 02:17 PM
Last Post: Tarik Sheth
  Edit Recovery Scenario skegler 0 3,350 03-05-2014, 10:40 PM
Last Post: skegler
  QTP 11, Win 7 - Issue while saving the Excel through the script.bu fine in XP sivasuman 0 2,407 11-15-2013, 01:38 PM
Last Post: sivasuman
  How to solve / record SAP (Transaction code PA40) Infotypes sequence problem in QTP kamal262007 0 2,376 02-04-2013, 11:25 AM
Last Post: kamal262007

Forum Jump:


Users browsing this thread: 1 Guest(s)