Exam UiPath-ADAv1 Topic 1 Question 60 Discussion
Actual exam question for UiPath's UiPath-ADAv1 exam
Question #: 60
Topic #: 1
Question #: 60
Topic #: 1
Suppose a developer is working with a 2023 yearly calendar. To expand the calendar into a monthly view, the developer must always click on the 15th day of the current month and add an event.
The selector for the Event Date Element activity in March is presented as follows:
<wnd app='applicationframehost.exe' title='Month View - Calendar' />
<uia cls='Day' name='15 March 2023' />
How should the selector be altered to guarantee that it clicks on the 15th of the ongoing month?
The selector for the Event Date Element activity in March is presented as follows:
<wnd app='applicationframehost.exe' title='Month View - Calendar' />
<uia cls='Day' name='15 March 2023' />
How should the selector be altered to guarantee that it clicks on the 15th of the ongoing month?
Suggested Answer: B Vote an answer
Explanation
This is the correct option because it uses wildcards to replace the dynamic parts of the selector. Wildcards are symbols that enable you to replace zero or multiple characters in a string. They are useful when dealing with attributes that change dynamically in the selector. There are two types of wildcards: asterisk () and question mark (?). The asterisk () replaces zero or more characters, while the question mark (?) replaces a single character. In this case, the name attribute of the target element changes according to the month, but the day and the year remain constant. Therefore, the selector can be altered by replacing the month name with an asterisk () and the last two digits of the year with two question marks (??). This way, the selector will match any element that has the name starting with 15, followed by any characters, followed by 20, followed by any two characters. For example, the selector will match 15 March 2023, 15 April 2023, 15 May 2023, etc. The other options are incorrect because they either do not use wildcards, or they use them incorrectly. Option A does not replace the last two digits of the year, which may change in the future. Option C replaces too many characters with the asterisk (), which may cause ambiguity or false matches. Option D uses the question mark (?) incorrectly, as it should be used for single characters, not for spaces or multiple characters. References: Selectors With Wildcards
This is the correct option because it uses wildcards to replace the dynamic parts of the selector. Wildcards are symbols that enable you to replace zero or multiple characters in a string. They are useful when dealing with attributes that change dynamically in the selector. There are two types of wildcards: asterisk () and question mark (?). The asterisk () replaces zero or more characters, while the question mark (?) replaces a single character. In this case, the name attribute of the target element changes according to the month, but the day and the year remain constant. Therefore, the selector can be altered by replacing the month name with an asterisk () and the last two digits of the year with two question marks (??). This way, the selector will match any element that has the name starting with 15, followed by any characters, followed by 20, followed by any two characters. For example, the selector will match 15 March 2023, 15 April 2023, 15 May 2023, etc. The other options are incorrect because they either do not use wildcards, or they use them incorrectly. Option A does not replace the last two digits of the year, which may change in the future. Option C replaces too many characters with the asterisk (), which may cause ambiguity or false matches. Option D uses the question mark (?) incorrectly, as it should be used for single characters, not for spaces or multiple characters. References: Selectors With Wildcards
by Fabian at Dec 14, 2023, 06:45 AM
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).