Condition in IF-Condition in UiPath - uipath

Due to the fact, that i´m completly new to UiPath, I need some minor help implementing an if condition.
My Problem:
Im using the Bot to search for several Post sendings in the Browser on the DHL-Homepage. The Bot works fine, but due to changes on the Homepage, minor changes have to be done.
The tasks are: Open Browser, clicking a field, type something in the field, click the button for search. In some cases, after clicking the search button, the system wants to know the shipping date. Now I need to implement an if-condition. If the field for Shipping date appears, then type the date and click the search button again. Else go ahead with the next step. The If and Else sequences are implemented already, but i cant figure out how to implement the necessary condition [VB-Ausdruck eingeben].
You can see the If-Else Condition below.
Hope the problem is clear and someone can help me.
Thanks a lot!

Found a solution.
I´ve added an 'Element Exists' before the If-Activity. Declared an Variabletype 'boolean', and wrote in the If Condition 'booleanOutput=True' -> If the field, which is indetified by the Element Exists- activity, the Then part will start, otherwise the empty Else part starts.

Related

Some kind of Dashboard in FullCalendar

yeah what more to describe
I have no clue how to do that. Setup fullcalendar, fetsch data and enter data works fine.
The last thing I needit is a Dashboard under the Calendar witch get the selected week that visible in the Calendar (would be great when act also with the prev and next Arrow Buttons form the Calendar), and get the summary Events from selected Week witch holds already the durration of the single Events.
Do you know what a mean? and shy asking would you be ma hero?
Maby i found the Solution
main.js
weekNumberClassNames: function(view, element){ $('#card-title').html(calWeek); }
Let the magic happen by every view change, it also the WeekNumber change
A big part is solved.

GTM tag not firing - Conditions being met

I want my GTM tag to fire for some clicks by using the elementClasses from the Object stated below. I've tried different configurations for the tag and trigger but nothing seems to work. It's not firing.
After searching for a specific drug (e.g. advil) on this site https://www1.shoppersdrugmart.ca/en/internal/rx-inventory then several options appear with the 'Check Availability' button on the far right. Once clicked it opens a pop-up window. I'm trying to track the number of clicks on that button but to no avail!
NB I have admin access to GTM and GA360 for this account.
Would appreciate anyone's help. Banging my head against the wall!!
Object
event:"gtm.click"
gtm.element:"[HTMLElement]"
gtm.elementClasses:"drug-inventory-results-table__availability-icon"
gtm.elementId:""
gtm.elementTarget:""
gtm.elementUrl:"https://www1.shoppersdrugmart.ca/static/drug-inventory/images/check-availability-button.png"
gtm.uniqueEventId:143
Have you tried using matchesRegEx(ignoreCase) instead of the equals in the trigger?

what is the best way to switch from or exit from formFlow to Dialog in Bot Framework

Here is my Basic Code
The formFlow works fine and after checking the if condition ,it should go to the else part ,which it does, but in the else part the wrote this line of code
await Conversation.SendAsync(activity, () => new AskMeAnything());
AskMeAnything is a class implementing Idialog. The problem is ,its again going/calling the formflow rather than jumping into the above mentioned dialog.
I read about IdialogStack but unable to understand how to remove the dialog on top of stack or something related to it.
i need help in moving to other dialog without looping into formflow.
Thanks
The first time you call Conversation.SendAsync(...) you actually create a root dialog for your conversation. Every consecutive call to the bot will still enter the controller but will be routed to the dialog at the top of the stack.
So when you call Conversation.SendAsync(...) for a second time you are actually trying to change the root dialog in the stack. I don't think this is possible and that's why your form is called again.
To solve this problem I would create a different dialog and make that dialog your root dialog. From this root dialog you can call your form and any other dialog.

How do I refresh a "form element" when it is changed through a webbrowser control?

I am using VB6 (yes, I know it's 10 years old :), but it works). VB.NET answers may work as well, so if you know the answer, please answer too!
I am "manually" setting a dropdown box in a form, yet the 'webbrowser' doesn't seem to update.
Here's an example
If you notice in the form, it has a place where it asks you to fill in a state. (I.e., california, etc). It looks like a javascript/DHTML popup box in MSIE (firefox doesn't do the same, so you need to use MSIE, since that is what the webbrowser control relies on). If I 'click' on the "state" field, a popup box appears. I then can say select "CA" for california, and it updates it. (It now says "CA").
If I progrmatically do it, I would do something like:
WebBrowser1.forms(2).elements(13).value = "CA" ' (sets it to 'california')
WebBrowser1.forms(2).elements(13).item(9).selected = true (makes sure it is 'selected')
However -- within the webbrowser control -- it still appears as if nothing has changed. (In reality it has, i.e., if I submit the form it will submit the correct info), but it just doesn't "update" it.
Do you have any idea how I can do a "forced" refresh (either progrmatically or through some javascript/dhtml refresh), that will correctly then 'update' the field to show that "CA" has been selected?
Thanks very much!
The last VB version I used was VB3 so forgive my VB grammar :)
If the change event has a handler that you want to simulate
WebBrowser1.forms(2).elements(13).item(9).fireEvent ("onchange",WebBrowser1.Document.createEventObject())

Using Watir on Peoplesoft App: each text field reloads the page

I'm using Watir 1.6.7.
I'm working on developing some regression tests for a PeopleSoft App using Watir and Cucumber. I have run into a few issues with forms in the application.
First, when entering a value into a text_field, the page refreshes when the user clicks outside the text_field. Waiting for the next text_field element to exist is problematic because it may locate the element before the page reloads, or after the page reloads as expected. Increasing the wait time never feels like a good solution, even though it "works".
The second issue is that the page refresh is not triggered until the user clicks outside the current field. In this case, that happens when the script tries to access the next text_field to be populated. One solution here would be to send a or keystroke, but I can feel the script becoming more brittle with every addition like this.
Are there any other approaches that would be less brittle, and not require 2-3 extra commands in between each text_field action?
The play-by-play looks like:
Browser navigates to page that contains the form.
Browser fills in first form field. (fix: send keystroke to cause page refresh, wait_until second field is visible again)
Browser selects the second form field to be filled out. (again, keystroke & wait_until)
Page refreshes, script fails. (resolved)
Browser selects the third form field...
The application started exceeding the 5 second sleep duration, and I did not want to increase the wait time any longer. I wanted to see what would happen if I populated the text field faster using "element.value =" rather than character by character with "element.set ".
This change completely resolved all complications. The page no longer refreshes when entering text, and no long requires a send_keys statement to use TAB or ENTER to move to another field. The form is storing all of the data entered even though there are no refreshes or state saves between fields.
Previous method:
def enter_text(element, text)
element.set text
#browser.send_keys("+{TAB}")
sleep 5
Watir:Wait.until { element.exists? }
end
New method:
def enter_text(element, text)
element.value = text
end
Firstly, there are interesting Wait methods here: How do I use Watir::Waiter::wait_until to force Chrome to wait?
Overall, I don't quite understand your problem. As I understand it your script is working. If you could be a bit clearer about your desires compared to what you already have that would help, as would some sample source code.
If you're looking for ideas on custom waiting you could check for changes in the HTML of your page, form or text field. You could check that the text field is .visible?. You could try accessing the next text_field (clicking it, or setting the value for example), then catch the exception if it can't find the text_field and retry until it doesn't break, which would solve both your problems at once.
Why would clicking outside the current field be a bad solution? Do you absolutely need the next step to be a text_field access? I haven't gotten my head around how the next field only exists when you click outside the current field, but you cause this refresh by accessing the next field.
Edit: Most welcome, and thank you for clearing that up, I think I now understand better. If you allow Watir to invoke its page wait, or force it to, then it will wait for the refresh and you can then find the new text_field. Keystrokes do not invoke ie.wait, so if you send a single keystroke, then invoke a wait then the rest of your script will be responding to the post-refresh state.
I highly recommend the OpenQA page on waiting in Watir. If what you're doing to invoke the refresh does not appear on the list of things that invoke Watir page waits then you need to invoke your own page wait... but you need to do it before the page refreshes, so the cause of the refresh should end before the end of the refresh itself.
I don't know peoplesoft's app well enough to know this, but Does the app display anything for the user while it's processing.. like some kind of little 'loading' graphic or anything that you might be able to key off of to tell when it's done?
I've seen apps that do this, and the item is just an animated gif or png and it is displayed by altering the visibility attribute of the div that contains the graphic. In that instance you can tell if the app is still loading by using the .visible? method on that element and sleeping for a while if it's still there.
for the app I'm testing (which has one of those 'icons') I created a simple method I called sleepwhileloading. all it that is does is use a one second sleep wrapped in a while loop that looks to see if the loading icon is visible. works like a charm

Resources