Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step (343 Views)
Reply
Visitor
syed088
Posts: 3
Registered: ‎11-10-2013
Message 1 of 6 (466 Views)

Using .Net Application and I want Double Click on DataTable Row to proceed to next step

I am testing a .Net Application where in which I want to select a row from data table by double click on it

The Scrip is creating by QTP is

SwfWindow("Welcome").SwfWindow("Encounter").SwfWindow("CPT Codes").SwfTable("lstDisplay").SelectRow 0

 

and I try  this script but it is not working

SwfWindow("Welcome").SwfWindow("Encounter").SwfWindow("CPT Codes").SwfTable("lstDisplay").DblClick 5,89

 

I just want to double click on row 0

 

can anybody help me how to resolve this?

Please use plain text.
Frequent Advisor
pavanpy
Posts: 56
Registered: ‎04-11-2013
Message 2 of 6 (447 Views)

Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step

To click on a particular row use this method: SwfTable().SelectRow 0

 

To dblClick on a particular row use this method: SwfTable().ActivateRow 0

 

When you use SwfTable("lstDisplay").DblClick 5,89 -> it will click on the co ordinates for that table. So 0,0 will point to left top corner of the table and so on. Hence by using dblClick method on a table, you will not be able to clearly use it on rows or cells particularly.

 

+pavan

 

Please use plain text.
Visitor
syed088
Posts: 3
Registered: ‎11-10-2013
Message 3 of 6 (440 Views)

Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step

This is not working

SwfWindow("Welcome").SwfWindow("Encounter").SwfWindow("CPT Codes").SwfTable("lstDisplay").ActivateRow 0

 It give the "General Run error"

SwfWindow("Welcome").SwfWindow("Patient Encounter").SwfWindow("CPT Codes").SwfTable("lstDisplay").ActivateRow 0

Please use plain text.
HP Expert
vzamoraz
Posts: 496
Registered: ‎04-12-2012
Message 4 of 6 (410 Views)

Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step

Try device replay.

 

    Take first the position on screen of the table

    myx= Browser().Page.Webtable().GetROProperty("abs_x")

    myy= Browser().Page.Webtable().GetROProperty("abs_y")

 

    note: abs_x and abs_y return the left top corner of the table

 

    then use dive replay taking the base the x and y coordinates

    set DeviceReplay = CreateObject("Mercury.DeviceReplay")
    DeviceReplay.MouseDblClick myx+5,myy+89,0

    set DeviceReplay = nothing

 

Regards

 

 

Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

 

Also remember if you have a valid contract with HP feel free to visit our FT/QTP Support Customer Forums: http://h30499.www3.hp.com/t5/Functional-Testing-QTP/ct-p/sws-Fun_Test
You can create an account with your HP credentials

 

 

Please use plain text.
HP Expert
Ana_Noncheva
Posts: 245
Registered: ‎08-06-2013
Message 5 of 6 (398 Views)

Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step

Hello,

 

Is this method not working for this row only or for all? How about "SelectRow 0" - is it giving any error messages?

Please also try with ActivateCell with the row you want selected and column 0.

Another suggestion is to try with the table's internal methods through .Object property: http://support.openview.hp.com/selfsolve/document/KM177318

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
Please use plain text.
Occasional Visitor
MGSMITHQA
Posts: 1
Registered: ‎02-24-2012
Message 6 of 6 (343 Views)

Re: Using .Net Application and I want Double Click on DataTable Row to proceed to next step

I've had a similar issue with using our swftable objects in our .NET application.  SelectRow was working before upgrading to UFT 11.53.  Now, it no longer works.  

 

In particular application, I only needed to highlight a row and then select one cell within it.  I was able to do a workaround using the following code...

 

SwfWindow("MainWindow").SwfWindow("SubWindow").SwfTable("grdData").SelectCell iRow, iColumn

 

I used the GetColumnNo("ColumnName") function to get the correct column reference.

 

Hope this helps, but really hoping that HP fixes the issue with the SelectRow function:)

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation