From the course: UiPath Essential Training

Recording a login - UiPath Tutorial

From the course: UiPath Essential Training

Start my 1-month free trial

Recording a login

- [Instructor] Now we've seen the process that we need to develop. We're going to create our first component. This component is going to log in to the ACME Academy. In order to get started, we're going to use the Robotic Enterprise Framework template. This is the industry standard for development. There are a lot of additional workflows within this framework, so don't worry too much. It's important that we use this so that we can save time later on. We're going to call this process the ACMEAcademyProcess. And this is the name of our project file. We're greeted with the State Machine, and again, don't worry too much. But first of all, what we want do is we're going to create a new component. This component is going to be called ACME_Login. It's always a good idea to name your components with something sensible. Click Create, and we're greeted with a blank screen. It's good to create a separate folder for the components that apply to specific applications. In this case, we're going to click Add New Folder. ACME. And we're going to drop our ACME_Login component into the ACME folder. A component is effectively a function which can be stored in a separate workflow. This allows us to break up our project into manageable chunks. A component can be a sequence or a flowchart. Typically, components are held in sequences because they are a short series of events which we don't want to get overcomplicated. So now we've got our ACME_Login component. We're going to use the recorder to record the steps for us and see what the results are. We're going to click Web, and when the toolbar pops up, let's click Record. Please note that when we're recording this process and developing it, we'll be doing it in Internet Explorer, not in Chrome. Let's navigate to our Internet Explorer window. Now, if you want to temporarily pause the recorder, you can press F2 which gives you three seconds to load the application that you want to load. As you can see, UiPath automatically recognizes elements on the page. In this case, we want to click into the Email box and type our email address for the application. We want to click into the Email box, and write and enter our email address for the application. (keyboard clicking) Let's click Empty field to make sure the field is always empty before we enter that information. Press Enter. You can see that the robot types the information automatically. Next, click into the Password box. This time, click Type password, to ensure that others can't see your password as you're typing it and to inform UiPath that this is a password field. Also click Empty field. Type in your password, click Enter, and again, the robot enters that information. Next, click Log In, and you should be greeted with the Dashboard. Press Escape to stop the recorder, and make sure you click Save & Exit so you don't lose your recording. We can see that UiPath has recorded each of the steps that we took. It has attached to the browser window, and if we look at the Selector, we can see that the browser window name is the ACME System 1 Account Log In page. It's typed the user email into the Email box. It's then securely extracted the password and typed that password into the Password box. Here you can see that it has used a variable, so in the Get Password activity, the result is the password variable. If we look into the Variables panel, we can see a new variable called Password has been created of type String. Then we can see that the button's been clicked to log in. And if we look at the Target, this also shows a Selector. And in this case, we can see that it's a button that belongs to the ACME System 1 application and has an id of buttonLogin, and of course a tag, BUTTON. The Selectors are vital because these are the ways in which UiPath recognizes the elements that it's working with. For example, if there's a button in an application or if it's a text field in an application, it needs to know that it's clicking the exact button that we want to click. There may be elements in the page which have the same information or similar information. We need to make sure that it's specific enough so that it picks the right option and only the right option, but generic enough so that it can work for multiple cases. So, for example, if the user's name was included in the account login application name, we'd want to remove that. We can do this by adding a wildcard into the title or any of the element names to make sure that the Selector works for multiple instances. So let's log back out, and let's run this robot to see what happens. We can see that it enters the username, the email address, clicks Log In. And if we go back into the application, we can see that the Dashboard has been reached successfully.

Contents