Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need Script for the below scenario which will solve my actual issue
#1
Solved: 11 Years, 3 Months ago
Hi ,

Need Script for the below scenario which will solve my actual issue

Go to google page --> right click on empty space--->will get a window with(Back,Forward,Search all ,paste etc).

Here pls tell me how to write a script to check whether Window exists on right click or not.

Pls provide descriptive script .I have figured for right click .Just tell me how identify the window exists or not.

Thanks in advance.
Reply
#2
Solved: 11 Years, 3 Months ago
Pls frds...someone help me in this...

Actual Scenario :

On a Right Click of an Image in a Web Table I get a Web Element && right click on other image i get a window...I need to identify image which will give me Window and ignore it. Pls do help me in this.
Reply
#3
Solved: 11 Years, 3 Months ago
Senior members ...help me in this....can you pls tell me atleast is this possible ...? Need to identify a window on right click of a image in web application..
Reply
#4
Solved: 11 Years, 3 Months 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
#5
Solved: 11 Years, 3 Months ago
Hi ...I found a solution for my Issue 1 ..not sure whether its the right way...I just found if put a msgbox next to if condtion..code is executing without manual intervention so it wrote the follwoing code...

Still pls help me in my issue 2...I will tell my issue 3 latter...Still i see no answer or suggestion from a member...pls do help ..it will give me some confidence that i too can learn QTP...
Code:
If Window("Window_2").WinMenu("ContextMenu").Exist Then
    Set a=createobject("wscript.shell")
msgbox_message="Not Nokia App"
msgbox_time=1
msgbox_title=""
a.popup msgbox_message,msgbox_time,msgbox_title

Set a=Nothing
    index_count = index_count + 5
    else
Reply
#6
Solved: 11 Years, 3 Months ago
hi all..I found solution for
Issue 2 : If it goes into the below else part of If condtion (on right click of a image in webtable),a webelement 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.

If Window("Window_2").WinMenu("ContextMenu").Exist(1) Then...Seems If i use .Exist it will take more time..so had mention the Time for (Exist) .Exist(1)....

I have one more Doubt....

Issue 3 : In this whole script for just one line Window("Window_2").WinMenu("ContextMenu")...I had record in QTP rest I did with descriptinve ...

Can any one suggest to make it as descriptive..?

As to identify the window in web App...I did this Tools-->Object Identification-->Environment--->Standard Windows-->Window Object (in Test Object classes)-->Mandatory Propertied--->Add/Remove--->Check Visible Property...And recorded in QTP....

Is this the only solution or is there any work around...Pls suggess...
Reply
#7
Solved: 11 Years, 3 Months ago
You can change the Object Synchronization timeout.

Go to FILE --> Setting --> RUN --> Object Synchronization timeout
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Create Video of a scenario shivangshah 0 1,217 01-30-2017, 07:45 PM
Last Post: shivangshah
  Default recovery scenario TurtleRock 1 2,901 05-30-2014, 02:17 PM
Last Post: Tarik Sheth
  Edit Recovery Scenario skegler 0 3,252 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,273 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,284 02-04-2013, 11:25 AM
Last Post: kamal262007

Forum Jump:


Users browsing this thread: 1 Guest(s)