Contributions
Re: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hi Robert, Sorry for the delayed response. I was playing around with the code and finally, I got a solution for this.I've replaced WaitAliasChild withWaitWinFormsObject method. This is working as expected and my code is successful now. Here is the new code which fixed the issues. If Aliases.cwConsole.WaitWinFormsObject("frmCrystalReport", 30000).Exists Then Thank you very much for your ideas and for helping me to fix the issues. I will be testing the new code and will get back to you if I get any further issues.3.1KViews0likes0CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hi Richard, I agree with that point. But my doubt is that when I use, Aliases.cwConsole.frmCrystalReport.Exists OR Aliases.cwConsole.WinFormsObject("frmCrystalReport").Exists instead of, Aliases.cwConsole.WaitAliasChild("frmCrystalReport", 10000).Exists it showed the following error when the Crystal Report is unavailable, The object with the specified attributes does not exist. That was my original concern, When I used WaitAliasChild method as per your suggestion, it is not showing the error. But it satisfies the condition when the objectdoes not exist. Here is the screenshot of the Object Property window for the Crystal Reports viewer.1.8KViews0likes2CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hi Robert, I tried extending the timeout to 20 seconds earlier. Now, as you mentioned, I tried with 2-minute Timeout. Still, it is not giving the right output. I think it is not waiting for the CR object. When I checked with the breakpoints, it is passing to the next statement without waiting for the timeout period. Let me make it clear: If Aliases.cwConsole.WaitAliasChild("frmCrystalReport", 10000).Exists Then Log.Message("Crystal Report") Else Log.Error("Error message") End If In this code, I always getLog.Message("Crystal Report") as the result even if the Crystal Report object is actually unavailable. I'm not getting the Else statement for any of the scenarios. Here is a screenshot of the Object Properties window of the Crystal Report.1.8KViews0likes5CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hi Robert, Here is the code. If Not Aliases.cwConsole.WaitAliasChild("frmCrystalReport", 5000).Exists Then "Do this" Else "Do that" End If OR If Aliases.cwConsole.WaitAliasChild("frmCrystalReport", 5000).Exists Then "Do that" Else "Do this" End If2.3KViews0likes7CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Thanks for thisRobert Martin. It works when the Crystal Report object does not exist. But when it is available the checking fails again. Scenario 1 - Crystal Report object does not exist. (Success) Both the 'IF' and 'IF NOT' conditions are working fine. Got the expected result. Scenario 2 -Crystal Report object exists. (Failed) IF and IF NOT conditions gave the wrong result. It shows similar to Scenario 1. My code is ready when Scenario 2 works.2.3KViews0likes9CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Thanks for thisRobert Martin. It works when the Crystal Report object does not exist. But when it is available the checking fails again. Scenario #1 - Crystal Report object does not exist. (Success) Both the 'IF' and 'IF NOT' conditions are working fine. Got the expected result. Scenario #2 -Crystal Report object exists. (Failed) IF and IF NOT conditions gave the wrong result. It shows similar to Scenario 1. My code is ready when Scenario #2 works.2.3KViews0likes0CommentsRe: 'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hello Shankar, Thanks for your reply. I tried the unchecking 'Stop On Error' and it did work. But, I'd like to stop the script execution on error windows. If I disable this thing the script may not stop when there is actually an error object. Is that right? I've tried using the mapped name and I got the same error message for many times. That's why I tried using the full name. If Not Aliases.cwConsole.frmCrystalReport.Exists Then2.3KViews0likes14Comments'The object with the specified attributes does not exist.' error while checking for a CrystalReport
Hi All, Kindly help to resolve object checking errors on the VB Script. \I've been writing VB Script test cases for our windows application product. Below is the testing scenario that fails. Our application provides some user activity reports to the administrators. The reports will be populated on Crystal Reports report viewer. Test case and Scenario: 1. Run the report without making any selection. 2. If the report selection is not done, then a custom message box will be displayed. 3. Close the message box. 4. Make the selection and run the report. 5. If there is no data to be reported, then a default windows message box will be shown. 6. If the data is available, then it will be opened on Crystal Reports viewer. 7. Close the current report. 8. Repeat step #3 to #6 for the next report. 9. Repeat the same for almost 21 different reports. On the VBScript, I have created this scenario as follows and it works fine except one error. 1. Check for the output. 2. If exist custom message box - then close it and make a report selection. 3. Else, check If exist crystal reports viewer. Then close the report and continue to next step. 4. Else, close the windows default message box assuming there is no data to be reported. The issue happens and execution fails at stage #3 from the above. If there is no Crystal Reports viewer available then the whole checking is getting failed with the following error. 'The object with the specified attributes does not exist.' Code from my script: Function RunReport (rptOption) Set frmReportOptions = Aliases.cwConsole.frmReportOptions Set Rep = Sys.Process("cwConsole.exe").winformsObject("frmCrystalReport") Call frmReportOptions.gbReportType.cboReportTypes.ClickItem(rptOption) frmReportOptions.btnRunReport.ClickButton Sleep 6000 err.clear on error resume Next If Not Aliases.cwConsole.dlgBrowseReporter.btnOK.Exists Then If Not Sys.Process("cwConsole.exe").winformsObject("frmCrystalReport").Exists Then Aliases.cwConsole.WinFormsObject("frmMsgBox_Specific").WinFormsObject("panel1").WinFormsObject("btnOK").ClickButton Aliases.cwConsole.frmReportOptions.WinFormsObject("gbSpecificURLs").WinFormsObject("lnkApplication").Click Aliases.cwConsole.WinFormsObject("frmSpecifiedUrls").WinFormsObject("groupBox1").WinFormsObject("txtURL").Click Aliases.cwConsole.WinFormsObject("frmSpecifiedUrls").WinFormsObject("groupBox1").WinFormsObject("txtURL").SetText("Chrome.exe") Aliases.cwConsole.WinFormsObject("frmSpecifiedUrls").WinFormsObject("groupBox1").WinFormsObject("btnAddUrl").ClickButton Aliases.cwConsole.WinFormsObject("frmSpecifiedUrls").WinFormsObject("btnApply").ClickButton Aliases.cwConsole.WinFormsObject("frmSpecifiedUrls").WinFormsObject("btnOK").ClickButton frmReportOptions.btnRunReport.ClickButton Else Aliases.cwConsole.frmCrystalReport.Close End If Else Aliases.cwConsole.dlgBrowseReporter.btnOK.ClickButton End If Sleep 2000 End Function Thanks and regards, Amal Codework Inc. amalashok@codework-solutions.comSolved3.2KViews0likes16Comments