Hello,
I am working on .Net application automation using UFT 11.53 and Infragistic TestAdvantage10.2 (Version: 10.2.20102.2023)
The Scenario is SwfTable Cell having an button, if we click on button calendar will expand and from calendar need to select date and same will be populating in the cell.
I have tried by recording method and below is generated script, and while replaying, script running without error but Date is not setting into cell.
SwfWindow("Hsment").SwfTable("ugS").ActivateRow "0"
SwfWindow("Hsment ").SwfTable("ugS ").ActivateCell "0","Visit"
SwfWindow("Hsment ").SwfTable("ugS ").SetCellData "0","Visit","12/16/2014"
And, also tried below method , it doesn’t worked.
sBandNum = "0" sRowNum = "0" sColName = "Visit" iActionEnterEditMode = 24 iActionExitEditMode = 44 SwfWindow("Hsment ").SwfTable("ugS ").").ActivateCell sRowNum, sColName SwfWindow("Hsment ").SwfTable("ugS ").Object.PerformAction(iActionEnterEditMode)
SwfWindow("Hsment ").SwfTable("ugS ").SetCellData sRowNum,sColName,"12/16/2014"
Please let me know if any other method to set calendar date into cell.
Thanks,
Saroja
Hi Saroja,
Thank you for posting to our forums.
An alternative way to do this would be to use the SetNAProperty method. You could use the following line to set the Date for the first row in the column “Visit”:
SwfWindow("Hsment").SwfTable("ugS ").SetNAProperty "Rows[0].Cells[Date].Value","12/16/2014"
Please let me know if you have any additional questions.
Thanks, Dimitar.
I tried as you explained still date values are not setting into cell.
Please let me know if you need any additional information.
Thank you for the reply.
Is there any errors when you are trying to replay this or is it just nothing happening? What version of Test Advantage and Net Advantage do you use? Is this issue happening only for the application that you are currently testing or it can be reproduced on other applications? After you use the SetNAProperty method, if you try:
SwfWindow("Hsment").SwfTable("ugS ").GetNAProperty("Rows[0].Cells[Date].Value")
, what is the result?
Please provide me with the application that you are testing or isolate the issue in a small separate sample.
I am looking forward to hearing from you.
Hello Dimitar,
I have tried the way you suggested and nothing is setting to cell by SetNAProperty method.
And, also tried with with GetNAProperty methood after setting values by SetNAProperty method and GetNAProperty is returning empty value.
Test Advantage Version: 10.2.20102.2023
Net Advantage Version : 10.2.20102.1004
Please let me know if any additional information required from my side.
Are you able to provide me with your application, or a test sample that reproduces this issue, so I can test this on my machine? This will be extremely helpful in finding the root cause of this issue.
Thank you for your collaboration.
The Scenario is table cell having an button, if we click on cell button calendar window will appear and that calendar user will select the date and selected date will populate in the cell.
I tried to attach the screenshot but couldn't find attachment option, Please let me know how can attach the screenshot.
Please refer the attached screenshot.
I tested this scenario on my machine in a separate sample and both the SetCellData and the SetNAProperty approaches change the cell value. Is that issue –not being able to set the cell data for Date columns- reproducible in other scenarios or in other applications? Or is it specific only for this application? Again it would be really helpful if you are able to provide me with the application or a sample that reproduces the issue. This will allow me to pinpoint whether your issue is caused by the TestAdvantage configuration or by the application.
we are facing this issue only specific to this application.
I have checked with developer, this is how they setting date into cell -
I have tested this scenario, using a column which was set up using the provided code and it is still working fine. If the issue is present only for this application, then it would seem that it is related to it and that TestAdvantage is properly set up. Without having the application itself it would be difficult to guess what exactly might be the reason for this. Can you enter the date without dropping down the calendar? Have you tried using:
SwfWindow("Hsment").SwfTable("ugS ").PerformAction gridEnterEditModeAndDropdown
After the activate cell call and before the SetCellData one? What are the results?
I tried the way you suggested and below is the code.
SwfWindow("Houssment").SwfTable("ugS").ActivateCell "1","Last_Visit"SwfWindow("Houssment").SwfTable("ugS").PerformAction gridEnterEditModeAndDropdownSwfWindow("Houssment").SwfTable("ugS").SetCellData "1","Last_Visit","12/19/2014"
After executing the script nothing is setting to cell.
And also tried by below method but it doesn't worked.
Dim Param(2) Param(0)="1" Param(1)="Last_Visit" Param(2)="2" gridX =SwfWindow("Houssment").SwfTable("ugS").GetROProperty ("x") gridY =SwfWindow("Houssment").SwfTable("ugS").GetROProperty ("y") cellX =SwfWindow("Houssment").SwfTable("ugS").GetCellProperty (Param(0),Param(1),"X") cellY =SwfWindow("Houssment").SwfTable("ugS").GetCellProperty (Param(0),Param(1),"Y") cellWidth =SwfWindow("Houssment").SwfTable("ugS").GetCellProperty (Param(0),Param(1),"width") cellHeight =SwfWindow("Houssment").SwfTable("ugS").GetCellProperty (Param(0),Param(1),"height") dropdownButtonX = cellX + cellWidth -70 dropdownButtonY= cellY + cellHeight -7 SwfWindow("Houssment").SwfTable("ugS").Click dropdownButtonX,dropdownButtonY itemX = gridX + cellX +5 itemY = gridY +cellY + 1 item2Y = itemY + Param(2)*itemHeight SwfWindow("Houssment").SwfTable("ugS").Click itemX, item2Y
Please let me know what way you need application sample to resolve the issue.