I am pretty familiar with TSL but am not too up on QTP. However we are rewriting the Powerbuilder app that WR was used for in a DOT net environment. I have done a bit of VB scripting but not w QTP. I see that with the SwfComboBox I can get a row count (GetItemsCount) and the values (GetItem(i)). Is there a way to get a row count for a DataGrid - it records the object as SwfObject("iGrid4"). Apparently that object does not have a GetItemsCount or GetItem method. There is a GetTOProperties and GetROProperty but it does not appear that the properties include a row count, or item values.
The docs dont seem very clear about this, anyone have any info?
Yes, it is a custom grid. With .NET grids such as this, the best way is to go about using the native (.NET) properties and methods to get what you need. These properties and methods can be accessed by using the .Object on your test object for the grid. Refer to the documentation on that .NET grid available under download section at http://www.10tec.com/Home/Download/index.aspx.
For example: to get rowcount, you would probably do something like: Print "Number of rows = "& SwfWindow("yourMainWindow").SwfObject("iGrid4").Object.RowCount
I have come across your profile on HP quality center. I have been having issues with the grid in QTP.Please can you look at these errors and let me know if you have any solutions.
Thank you for the help. I have attached a zip files for the two errors I have been having with the application pricer.
1st error: "Cannot identify the object "WC1xxGrid" (of class WbfUltraGrid). Verify that this object's properties match an object currently displayed in your application."
In the attachment I have included the object properties screenshot and spy object screen shots. Also I have included the screen shot of the application pricer where I am getting this error.
2nd error: "object disabled error" and "Cannot identify the specified item of the select object"
In the attachment(find_a_person_app_error) I have included the
1) findaperson_dialog_box.bmp- Screen shot of application 2) findaperson_error.bmp- error message 3) findaperson_errorlines.bmp- errors line number and active screen shot 4) application_script_screenshot1.bmp and application_script_screenshot2.bmp- where I am getting the error and the application in the active screen. 5) object_disabled_error.bmp- Screen shot of object disabled error.
I'm having problem with an application "find a person" which is used by most of the application here at the company. When I record a script, the script does not run at the point where I recorded "find a person" application. I think because the application is dynamic, I just need to type the first few letters of the last name and it automatically gives me a drop down list of people matching the few letters I entered. Just like gmail when we enter the first few letters of an email ID, when we are composing a mail it gives a list of people we can choose from and we select one but QTP does not recognize this. I have tried using low level recording; Object repository; Smart identification mechanism but these don't work either. Please do let me know if you have a solution. The first three snapshots are the "find a person application dialog box errors".
Aarthi, didn't have time to go through everything, but it looks like you are going through typical issues found in pure record & replay use of QTP. Referring to the grid issue: I don't see any .Sync statements. Can you add Browser("yourBrowser").Page("yourPage").Sync before every statement that is causing object not found error for the grid(s) and try again? Issue2: you can type using sendkeys and I will post that separately. Do not use Set in the webedit. SendKeys should cause the list to open up. Try so far and let me know how things go. You can address me as Krishna, no need for Krishna Garu. Thanks.
Set WshShell = CreateObject("WScript.Shell") Browser("projectPricer").Window("Find person dialog -").Page("Find person dialog").WebEdit("text1").Click WshShell.SendKeys("ti") Set WshShell = Nothing Wait 2
Thank you, Krishna for the solutions will let you know how they workout. Yeah I know thatâ s a lot to read but I just wanted to clarify the errors I have been having. I thought the more information I gave the more it will help in understanding the errors. Anyway ,I appreciate your help.
"Set WshShell = CreateObject("WScript.Shell") Browser("projectPricer").Window("Find person dialog -").Page("Find person dialog").WebEdit("text1").Click WshShell.SendKeys("ti") Set WshShell = Nothing Wait 2"
Instead of the statement that is producing the error or do I add it just before the error statement? Also referring to the grid error I have tried the exist statement according to help in QTP but it did not help. Does the sync statement work different then exist statement? For example: exist statements for -> Browser (â yahoo!). page(â yahoo!â ).Link (â Arts & humanities â ). Click ---- Msgbox Browser (â yahoo!).Exist Msgbox Browser (â yahoo!).page(â yahoo!â ).Exist Msgbox Browser (â yahoo!). page(â yahoo!â ).Link (â Arts & humanities â ). Exist
Arthi, exist is not necessary here. Sync will help QTP wait for the page navigation to be completed after you performed some operation on something that causes a change to that page. Browser ("yahoo!".page("yahoo!").sync If that doesn't help, you can even use a statement like Wait 3 for example, to wait for 3 seconds between the end of an operation and the beginning of the next.
You need to get rid of the statement that does .Set on the web edit field. I can't copy and paste the lines from your bitmap, so if you post those actual code lines as text, I can show you how they should look like while using SendKeys.
I will post the code this evening because someone else is using QTP and I cannot access QTP until they are done with there work.Thank for the help krishna .I was so confused as i was not able to solve the errors.I am new to QTP.
I have included the script and the snapshot of the error in the attactment.please could show me how the sendkeys should look like and why i am getting this "Cannot identify the object "WC2xxGrid" (of class WbfUltraGrid). Verify that this object's properties match an object currently displayed in your application." ???????
I have included the script and the snapshot of the error in the attactment.please could show me how the Sync should look like and why i am getting this "Cannot identify the object "WC2xxGrid" (of class WbfUltraGrid). Verify that this object's properties match an object currently displayed in your application." ???????
Thank you so much; with your help I was able to fix the 2nd issue. Please if you can help with the 1st issue I would be so grateful to you. I did post/attach the script and the snapshot for the 1st issue as you asked me to.
Lets try this. I am assuming you can not see the grid manually either when QTP script says it cannot be found. If that is the case, sync and wait statements will help before trying to do anything with the object that cannot be found. If that is not the case and you can see the grid manually at that point, see if the object gets "highlighted" when you click on the highlight button in your object repository (OR). I am guessing it doesn't, which means its properties have changed. Relearn the object at that point to see what has changed and change your object description in OR accordingly. Actually, there are several ways to address your whole approach, but given your knowledge of QTP, and the fact that you are dependent on Record and Replay, what I suggest is that you upgrade to QTP 9.5, which has a new feature called Maintenance Run mode, which will help you in situations like this. In the end, you will need to play with your application (after carefully going through user guide and trying out various things) and fix it yourself for people on the forum don't have access to it. We can only guide you on some things to try based on our own experience. Just so you know things like this are a common occurrence in gui automation and when you figure it out yourself after you go through all the documentation, you will learn much more.
Thank you for the reply but yesterday I did try to add the sync and wait statements, they don't seem to work, I still get the errors although I don't know if I placed the statements in the right order. I am asking for you help because this project is due in a week and I am having these 2 issues with it that should be solved ASAP as no one else here knows QTP here in my team so I am solely responsible and if I have any questions also I cannot ask anyone. Please do let me know how to solve the grid issue. I sent the code where I am getting the error. Also right now I cannot upgrade to 9.5 as I have only a week to submit this project.
You did not address whether you are able to see the grid when QTP says it cannot find it. The solution depends on what actually happens when QTP says it cannot see it. Is the grid really there at that point and QTP is just not able to see it Or has the grid not appeared yet at that point, so QTP is right in saying that it is not there?
The grid is a drop down list when we choose one of the options from the drop down list it records it as "WC2xxGrid" unless we click on the button to see the drop down we cannot see the grid. Also after I run the script and go to OR and try to highlight the "WC2xxGrid" it does not get highlighted. I have included a snapshot of the application where the "WC2xxGrid" appears. Do let me know if you need anymore information.
What is in the code that is clicking on the button to open up that list or grid? Here are your lines. Browser("Pricer Grid Page").Page("Pricer Grid Page").WbfUltraGrid("WC1xxGrid").SelectCell "1","DESCRIPTION" Browser("Pricer Grid Page").Page("Pricer Grid Page").WebEdit("WebEdit").Set "raw labor" Browser("Pricer Grid Page").Page("Pricer Grid Page").WbfUltraGrid("WC2xxGrid").SelectCell "8","ORACLE_BILLING_METHOD_DESCRIPTION" ' <- error line
There is no image that shows that steps 1 and 2 above are performed. Step 3 is causing you the error so I would assume at the end of step 2, I should see "raw labor" set as input into some web edit. Where is the image of that and where is the code that would cause the list to open up in the first place?
You are right,I was trying to not click the side button as it gives me error and just selecting by clicking in the box.You can either click the button to open the drop down or click on the box to open the dropdown list.I can send you the code of with the image if that would be more useful.
You have to include code that contains all of the actions that you perform to make the list/grid open up. If some step is not recorded even though you performed the actions, you have to identify that first and rectify it. Re-record it if you have to.
In one of your bitmaps, I see a task bar item that says "QTP interview questi...". I hope all this is not from some interview. I cannot help you if it is so. Please clarify.
No krishna,I work at a company,i started working here 1month back.I was using the interview question for learn how to relearn the object properties as you mentioned in one of the replies this morning.
Also I attached the script with image in it. Q: Why is that when I record the script and run immediately without refreshing the page I don't get the grid error and it's recognized but when I refresh the page and then run it,it does not recognize the grid?