Question
Shuurgan
CN
Last activity: 6 Sep 2024 4:22 EDT
DEBUG is fine, but files executed after DEPLOY are problematic
My program has no problem at all in DEBUG test, but after DEPLOY with BAT execution there is a problem at a specific button (unrecognizable), I checked the original program without modification, the program reDEPLOY execution also has no problem, but in DEPLOY when picture one in ADDITIONAL REFERENCE is not any I have checked the original program without modification. But after I added two options to this program (I didn't change anything except the options), the three files in picture 2 appeared in DEPLOY. I doubt if this has anything to do with it, because it's the same program that I used, and I just added three option branches, but the rest of it didn't change, and I didn't touch the MATCH RULE either.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
@BAOX17175074Are you able to provide more information about what your issue is? It seems as though you have a button that doesn't match at Runtime when you execute the project from a BAT file. Is that correct? Are you able to locate the button in the Runtime Log? If you set the log categories to Verbose (log level 4), you should see all attempts to match the button. That would give you some information on which of the match rules may not be working. If your control is matching but the automation is not interacting with it, the issue may be that your screen is locked at Runtime and not during your testing. When your screen is locked, you cannot access controls through OCR or use SendKeys. A Runtime log though would be really helpful to determining what is happening.
Shuurgan
CN
I have checked my RUNTIME LOG several times, but there is not even an ERROR prompt at the corresponding key execution on this page. the corresponding error prompt in the log is the next step after clicking this key (e.g., the save screen is not detected), which has absolutely nothing to do with this key, so I don't know if it's just not being detected on this page, or not being detected by the corresponding key in this page.
BAO
Pegasystems Inc.
US
@BAOX17175074I am not sure I understand the problem you are experiencing. Do you have a step in your automation that isn't working? If so, then I would start with setting your Runtime Log categories to Verbose (logLevel = 4). Next, identify what isn't working as expected. Do you have a control not being clicked (or the text being set) as you expect? That might indicate a matching issue with that control or one of its parents or grandparents. In your log you can follow all the execution and data lines by looking for log lines containing "executionLink From:" and "propagating From:". Once you locate the step where your automation has failed, you can look above and below that line for any mention of the specific control that isn't matching. If you've enabled verbose logs, any attempts to match that control will be logged whether successful or unsuccessful. You might also need to search for the parent or its parent as well until you locate the one that is not matching. Matching occurs from the parent to the child, so if a parent doesn't match, the child won't match either.
Do you have an issue with deployment? If so, you can check your Studio Log (once you enable it) and locate any errors there.
Are you suggesting that the addition of those three assemblies to your deployment is causing the issue? If so, they can be removed, although I would not suggest that since they indicate an Excel Connector has been added and may be necessary. I would make a backup before I removed them.
@BAOX17175074I am not sure I understand the problem you are experiencing. Do you have a step in your automation that isn't working? If so, then I would start with setting your Runtime Log categories to Verbose (logLevel = 4). Next, identify what isn't working as expected. Do you have a control not being clicked (or the text being set) as you expect? That might indicate a matching issue with that control or one of its parents or grandparents. In your log you can follow all the execution and data lines by looking for log lines containing "executionLink From:" and "propagating From:". Once you locate the step where your automation has failed, you can look above and below that line for any mention of the specific control that isn't matching. If you've enabled verbose logs, any attempts to match that control will be logged whether successful or unsuccessful. You might also need to search for the parent or its parent as well until you locate the one that is not matching. Matching occurs from the parent to the child, so if a parent doesn't match, the child won't match either.
Do you have an issue with deployment? If so, you can check your Studio Log (once you enable it) and locate any errors there.
Are you suggesting that the addition of those three assemblies to your deployment is causing the issue? If so, they can be removed, although I would not suggest that since they indicate an Excel Connector has been added and may be necessary. I would make a backup before I removed them.
Feel free to attach a RuntimeLog if possible and I can take a look, although the log may contain proprietary information, so please only attach one if you are certain there is no data contained that cannot be public.
Shuurgan
CN
@ThomasSasnett My logs don't indicate in this section whether the page is undetectable or the keystrokes are undetectable, leaving me no way to make a determination. However, I was able to click the button properly when I tried it once this morning, but it started failing on the second try. What could this be due to?
BAO
Pegasystems Inc.
US
@BAOX17175074 It sounds like your issue is that you have automated a process to click a button, but this process fails to click the button after it runs through the first time. Is that correct? Your logs would indicate if the button was matched or not. You would look for this step in your automation and you could look above or below to see if the button was matched before or after the point in your automation where you expected it to be clicked (by searching for your control's name). If you can't find any information about your control, you might need to check its parent (and its parent, etc.) since matching occurs from the top down.
If this runs on your machine, but fails at Runtime when you deploy your code, the issue might be with your Runtime machine being locked (if this is an unattended bot). Things like SendKeys or screen OCR cannot work if your screen is locked.
I would start by identifying exactly what is or is not happening per your expectations. Narrow the problem down to the specific step in your automation that is not behaving as expected and look for that step in the log. Identify if any unexpected behavior is happening. Is a button being clicked (but it is the wrong one)? Is the PerformClick method being called, but no click is happening? Are there any errors on the screen or within the application you are automating? These will help you determine what your best course of action will be.
Shuurgan
CN
@ThomasSasnett Here's the thing, I actually added three option branches to the previous program, and going into each of the different options would do the same download upload and such. So I left the original program as is, except for the part where you go to one of the options where I use a call to EXCEL to get the URL. But after I made the change I get an error on a specific keystroke, I checked the logs this part doesn't indicate it, it just suggests an error about not sensing the pick file popup on the next pick file action, but in reality I need to click on the previous keystroke in order to see the popup, and there's no way for me to correctly click on that keystroke. With no changes made to the key settings page settings or the MATCH RULE, I'm wondering why the original program detects the key or the page, but a program that has not changed that part of the program does not sense it correctly.
BAO
Pegasystems Inc.
US
@BAOX17175074 I can't really say without looking at a log or seeing your application. If this is a publicly available application, can you provide details of what you are trying to automate? If not, often when something works the first time but not the second, it indicates that you have match rules that do not account for the change between executions. I have seen many pages that change URLs when you navigate back to a page after being there initially. I have also seen buttons change properties when they are clicked. Perhaps with more details I can assist.
Shuurgan
CN
@ThomasSasnett Sorry, this is not a public app. But I know that all the URLs of this web page do not change when clicked, they are all fixed URLs. and this part of the operation I used the original design of the control as well as the MATCH RULE, so it's hard to understand why there would be a problem when there is no change in the web page.The buttons and page sections are part of these two.
BAO
Pegasystems Inc.
US
@BAOX17175074 Are you able to share a screenshot of that control?
Shuurgan
CN
@ThomasSasnett sure.
Pegasystems Inc.
US
@BAOX17175074 Is this a file upload dialog?
Shuurgan
CN
@ThomasSasnett Yes, after clicking on this button a popup for uploading a file will appear and select the file from it.
BAO
Pegasystems Inc.
US
@BAOX17175074 I think your issue is with the dialog itself. When you perform the SendKeys to the control to make the dialog appear, that thread is now blocked until the dialog is dismissed. I suggest you use a Parallel Process to separate the threads. On the first thread, you will perform the send keys to open the dialog. On the second thread, you will handle the dialog and ultimately close it. Coming out of the bottom of the Parallel Process, will be the steps you take after the dialog has been dismissed. I will see if I have an example handy, but that is probably what your issue is.
Shuurgan
CN
@ThomasSasnett Can you be more specific about how multithreading is controlled? For example, are there any problems with the method I'm using when I get to that page, or what other controls do I need to add before clicking the button after detecting the screen?
BAO
Pegasystems Inc.
US
In the screenshot, the PerformClick method of txtFileName does not return until the dialog has been dismissed. If you were not using a Parallel Process, you would never reach any steps after the PerformClick since they are blocked until the modal dialog has been dismissed. By using a Parallel Process, we can click the control that generates the dialog on one thread and handle the dialog on another. The bottom thread will be used to continue the remainder of the automation after the dialog.
Shuurgan
CN
Because I am getting the URL inside by opening the EXCEL to get to the appropriate project for subsequent operations. Now I want to ask the upload operation is one of the operations, here the URL only involves access to a different project, the operation inside the project itself is the same. I found that as long as there is an external open EXCEL operation before clicking this button operation, then the page or button will not be perceived, would this be a problem under normal circumstances? Then I would like to know how to write the multithreading you mentioned, can I trouble you to modify it on my basis of this? Thank you.
BAO
Pegasystems Inc.
US
@BAOX17175074 I am not following. Acquiring the URL from Excel should occur before any of this automation. I would build that separately and test it and then use the URL as an input to this automation. It should have no impact at all on this automation. I am not sure what you are referring to when you say your page will be perceived only when Excel is open. I assume by perceived you mean matched, and that doesn't make sense as those two things are unrelated. I would focus on building this as two parts;
- Acquiring the URL (or whatever you need from Excel).
- Automating the page to use that URL to download or upload the file.
These can be tested independently and then called in sequence in your final project.
Shuurgan
CN
I am using the methods associated with the excel component in the automation program and calling the URL in excel as it proceeds to the point where it needs to call the URL to go to a different page, which is actually part of the automation program as it proceeds and not the main page. So I can only call that URL from within the automation, but I experimented yesterday and if I don't open the excel step and directly use STRING to enter the specified URL, it will not be able to perceive the click button I mentioned at the beginning, so can you focus on the part where I can't click the button? Thank you.
BAO
Pegasystems Inc.
US
@BAOX17175074The best way to resolve this is to focus on the specific area where your automation is not working as expected. This is why I suggested breaking your automation into smaller parts. In my earlier suggestion, I mentioned executing your Excel steps before this automation. Those steps would not have any effect on this automation since the only interaction would be the data they passed in. Using Entry Point parameters, you can write automations that are independent from one another. Does it really matter in this automation where the data you are using for the URL comes from? If you are retrieving that value from an Entry Point Parameter, the source that passed that parameter could be anything.
If you can, please post screenshots of your updated automation. The last one I saw did not have the changes I suggested using the parallel process. If you've implemented that, I would like to see how you did to ensure it was accurate. Based on the last screenshot you posted, I cannot see the control you are using the generate the dialog. Please provide an explanation for each of the controls if possible. Here is an example below that you can replace the names with the names you are using.
Control X = Click this to generate the dialog
Control Y = This is the File Open Dialog
Control Z = This is the text field on the dialog I need to fill out
Control A = This is the control I click to dismiss the dialog
Shuurgan
CN
@ThomasSasnett I am now using this method to enter the target page to perform the corresponding download and upload operations (previously posted automation program for the upload operation), I do not understand how to run the automation program does not open the EXCEL so as to achieve the function of passing parameters. Can you explain? Thanks for your help.
Pegasystems Inc.
US
@BAOX17175074 My suggestion is to write one automation that acquires the data you need from Excel. It would return the URL you are navigating to as a parameter. You would then write a separate automation that works with the website. It would accept as inputs whatever parameters it needs to complete the work. These might be the URL to navigate to, the download location, etc.
The reason you want to separate functionality like this is to allow you to focus on specifically what parts of your automations need more work. It also makes unit testing easier if you segregate functionality.
Shuurgan
CN
@ThomasSasnett Thank you for your reply, I will make an attempt. BAO
Pegasystems Inc.
US
@BAOX17175074Those three assemblies might be added as references if you added an Excel Connector to your project. I don't believe any of them would be related to a matching issue.