Level 3 Assignment 2 - GetTransactionData: Element Exists

Hey guys,

I’m currently working on my second assignment and I have a question for you guys in regards to the dispatcher section.

When the sequence get to the “GetTransactionData” file it attempts to detect if the the next page exists with the help of a dynamic selector.

This is how my selector looks like:
ElementExistsImage

From what I understand the point of this Element Exist Asset is to identify if the next page exists or not. When I use UI Explorer to identify the selectors of the next page, it says that aaname=‘2’
In which case the first value that should be submitted to aaname using the in_TransactionNumber asset should also be equals to 2, yet default value that is passed to in_TransactionNumber by default is 1.
My question is, shouldn’t the argument in_TransactionNumber be incremented when sending it to Element Exists?

I looked everywhere (Unless I missed something) but I did not see anyone reference that issue and as far as I saw the selector for everyone else was not incremented either.

Hi @roman.markman

Its a good question. Considering the flow of this assignment, it works like this.

Just some background first
Init - Initializes the application and makes it ready
GetTransationData - Here, you pass the Transaction Number (which should be 1 initially), and checks whether that page is available just like you mentioned. Here, in the acme system, by default, you are already in page 1 in the work items. Though you are in page 1, still you need to check whether that page already exists. So, the selector you are using for that should be changed a bit actually. So, in GetTransactionData Element exists activity, use this selector.

"<html title='ACME System 1 - Work Items' /><webctrl aaname='" + in_TransactionNumber.ToString + "' tag='LI' />"

This selector returns the page availability irrespective of whether its the currently displayed page or not.

Going to Process state - Using the same transaction number, you perform a click activity to navigate to that page. now, Since we are already in page 1, actually we cannot click on that because that item is disabled. But with this selector, you can pass through that step quite easily. So, for the click activity of the Process state, use the below selector.

"<html title='ACME System 1 - Work Items' /><webctrl aaname='" + in_TransactionItem + "' tag='LI' />"

It is actually the same selector :slight_smile:

So this way, you also check whether the first page is available, and performs the click and then do the data scraping. Once the process is done, the execution process executes a xaml file called SetTransactionStatus.xaml. This is where the TransactionNumber variable is incremented by 1. So once it gets here, if the transaction number is 1, it increments to 2. then again it goes to GetTransactionData and checks whether page 2 is available. like wise, it goes on until you finish iterating to all the pages

So… you should start with 1, and using the correct selector is the key here :slight_smile:

Hope it helps!!

if this helps, please mark the answer as the solution so it can help others understand this flow :slight_smile:

2 Likes

Thanks for the reply!

Actually after sitting on it for a while I did figure out that since the click action comes before the data scraping, you had to essentially click on the same page for the first iteration. The reason I was so confused about this is that when I looked into my LI selectors, there was no “aaname” tag that I could use, so instead I used the “innertext” tax that would do the same job.

So the format of my Element Exist selector looks like this:

<webctrl innertext=’" + in_TransactionNumber.ToString + “’ tag=‘LI’ parentclass=‘page-numbers’” />

I guess I was just a bit confused about it since everyone was using the “aaname” tag which is inside the LI selector.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.