Hi there, I'm currently running on a trial license (of both QTP and TestaAdvantage) so I hope someone can help me quickly!
I am running QTP 9.5 with the .NET add-in; TestAdvantage 2008V1 CLR2, and the application I am testing is written in C# and using NetAdvantage 2008v1 CLR2, so the versions of test and net advantage do matchup.
Here's my problem: I want to be able to retrieve a value from a cell within an UltraWinGrid, when I record a simple click on a cell, QTP records this:
SwfWindow("EMS - Tomi").SwfObject("SwfObject").PaneActivate "Positions"SwfWindow("EMS - Tomi").SwfTable("grid").ActivateRow "10"SwfWindow("EMS - Tomi").SwfTable("grid").ActivateCell "10","Futures"SwfWindow("EMS - Tomi").SwfTable("grid").SelectCell "10","Futures"
When I immediately replay this script, I get an error on the second line (ActivateRow), this error says simply 'General Run Error' and then lists the line in error. Then if I 'skip', the following two lines also throw back the same error. I can seem to access various properties of the grid in a slightly different fashion, for example when I write a script like this (copied from a bit of code that is in one of the samples provided with TestAdvantage):
Dim gridSet grid = SwfWindow("EMS - Tomi").SwfTable("grid").ObjectSet col = grid.DisplayLayout.Bands.getItem(0).Columns.getItem(0)msgbox col
'col' in this case DOES return a value no problems. The only thing is that I am not familiar with the syntax when using the 'Object' method of getting properties, so I don't know if I can access or even set cell properties using this method (The help doesn't seem to provide any examples), and ideally I would like to get to the bottom of why a simple method such as ActivateCell is causing an error.
Does anyone have any ideas?
Many thanks, Ryan.
Hmmm, an interesting twist to the story: When I record an interaction with a different application (this one being a 'test' app and is much simpler in the sense that the grid is not contained within a large heirachy of containers) and replay that, then I CAN subsequently successfully replay the script in my first post!
It seems that whenever I restart QTP, I have to interact with this other application first before my recorded scripts work with my original application I am actually trying to test. Bizarre. I would like to try and find a solution that doesn't involve me having to interact with this other app before I can run my tests.
Cheers, Ryan
"General Run Error" is non-descript error that QTP throws when it is unsure of what is wrong. No error directly related to TestAdvantage code will to my knowledge throw such an error. That is not to say it might not be related to TestAdvantage, or it's setup but it does gives us a general scope of where to look. Let me ask some additional questions to help eliminate other possibilities. From what you are describing it sounds as if it records correctly so unless you manually manipulated yourC:\Program Files\HP\QuickTest Professional\dat\SwfConfig.xml file, your SwfConfig.xml file is likely configured correctly. If there was a possibility of that I would suggest running our Version Utility supplied with TestAdvantage, disabling TestAdvantage and re-enabling it.
I am guessing by your response that my next question would be unnecessary that being, can you record and replay correctly on the samples supplied? By your response I am assuming the answer is yes, that leaves it to something specific in your application an QTP.
The next likely cause is deployment based, that being sometimes an App tested remotely on a network or something similar can cause QTP to get confused in finding all the NetAdvantage assemblies required for our proxies to work correctly. What I would suggest is creating a local directory, adding all of the NetAdvantage assemblies to that directory, and then from their copy them into your global assembly cache(GAC) (typically located at C:\Windows\assembly ) Alternatively if you drop the assemblies in the bin folder of your QuickTestProfessional install directory, that can also resolve this behavior. This may be a distinct possibility with what you described because if your simple sample was on your test machine, not remotely, and had the dll's copy local, it likely found and loaded the dll's correctly, for that app which allowed your larger app to continue.
NOTE: if you change your SwfConfig.xml file, or drop assemblies in the Global Assembly Cache(GAC), or the QuickTestProfessional bin you should close both QuickTestProffesional and your application under testing.
Let me know how those work for you.
Hi Michael
This is Adi
I am facing the same problem as posted against your reply,I am unable to replay the samples provided by test advantage.As suggested by you i had placed all the dll's included in bin folder of net advantage in qtp bin install dir.Configurations done by me on QTP enables me to record test advantage methods such as setfocus,expandgroup etc but when i tried to replay the recoding QTP doesnot find these methods and gives general run error which u know doesnot details anything.When i tried to use object spy utility i saw that activate row method is available under test object methods.How can i access these methods can u please send me any helping script example.I am using the trial versions of test & net advantage. Once i am satisfied that we can automate our application using these tools and there is no hurdle in generating scripts then we can go through the licensing activities.So need your prompt reply hope u understand.
Thanks alot...........
Hi Adi,
Please confirm that "C:\Program Files\HP\QuickTest Professional\bin\QtPro.exe.Config" file contain the following:
<configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup></configuration>
If It does and you still get the error during replay. Back up this file and remove it from the Bin folder of QTP. then try again. Also try opening the script provided by TestAdvantage install. located in "C:\Program Files\Infragistics\TestAdvantage for Windows Forms (HP) 2008 Vol. 1 CLR 2.0\Samples\Scripts"
Hope that will help
Ammar
Hi Mr Ammar
I had done the activities u suggested moreover i am looking the test advantage samples for the last three days.But the same problem "General Run Error"exist on line "SwfWindow("WinEditors Within WinGrid").SwfTable("ultraGrid1").ActivateRow "0"" and following statements respectively.Things i had done are listed below.
Placed all the dll's from net advantage bin dir to QTP bin dir.
Used version utility of test advantage to update swfconfig file in dat folder of QTP.Changed the paths respectively of the dll's as per my installed dir
Changed the configuration in QTP.exe.config file as suggested.
My test advantage & net advantage are of same version i.e 2008 Vol 1 CLR2.0
Created a string varriable in regedit as given in help file.
But still during repaly "General Run error " occurs.One more thing Mr Ammar when i open the Object Repository i can see the Activate Row methodunder Test Object methods.Any idea if some DP concepts should be implemented can u plz give me any samples..
Adi,
I think this issue needs to be submitted to our Developer support. They will be able to help you debug this issue and find a resolution.
Regards,
We are also facing the same issue with TA 2008 V3.
Could you please let us know if you got some answer to your queries?
Hopefully it would help us resolve our issues as well.
Malayaj
We are facing the same issue at our end when we migrated to TA 2008V3.
Did you get any answers to your prayers?
Please share your findings with us.
Hi Mr ammar
Ok fine, I had already emailed them, thanks alot for your cooperation upto now, Will contact you again once things are fixed.
Have a good day
Regards
Adi