Method 1:
Try and find the first type of pop-up without the checkbox at the bottom.
If that errors out, try finding the second version. Based on which Boolean value evaluates to true, you use a different selector to read the message.
Method 2:
Second way is to write two different Selector expressions and then try to find them one after the other and pick the one that does not fail in a Try-catch block.
Method 1 worked for me. I did not pursue Method 2. The issue is that if the report has already been uploaded, you get an error pop up and you have to build Method 1 for the failure box as well. Here’s a screen shot of how I did it. If the sequence fails to find the two types of failure boxes, then I infer that it has to be one of the success messages.
Yep, I think that would be awesome! If you get a hit on the selectors, please do let us know. I plan to add this selector as a reusable asset to a couple of projects.
@AndyMenon I could not find a common selector but tried your method in a slightly different way which has worked as well.
I assigned the confirmationID to Nothing
I used a get text using the first selector with a continue if error = True
I used an if with a condition: confirmationID = Nothing
If it was I used a get text using the 2nd selector
From the selector of the second pop-up that has a checkbox at the bottom, it looks like it was ugly mashup of the first dialog box stuffed into an outer messagebox that has a checkbox option in it.
The second popup needs the outer clsid and aaname to identify the box on the inside, that also has another set of clsid and aaname. Kind of makes it tricky to make a common selector for both of them.
Will give this a shot once more. I tried dumbing it down to just the title “message from webpage”. That worked, but I wasn’t able to get at the message inside the box.
Hi @ColinCrabtree, I have been facing this exact issue from the past few days. Please could you share your .xaml or take a screenshot of the method that you have tried? I am stuck with unable to get the confirmationID from the popup with the checkbox. Thanks a lot. So far I tried with various selector options and none seem to work.
I ended of using 2 separate selectors in 2 different Get Text activities. One for the popup box that has the ConfirmationID without a check box and one for the popup box that has the ConfirmatioID without the checkbox.
1st Selector for popup box without checkbox:
Note: I set the ContinueOnError property to True for this get text
2nd Selector for popup box with checkbox:
I first used an assign activity to set the UploadConfirmation = nothing
I then used a get text activity with the 1st Selector (output value is UploadConfirmation)
I then used an if activity to check if the ConfirmationID was still nothing
If it was = Nothing I then used a get text activity with the 2nd selector (output value is UploadConfirmation)
NOTE: this worked for 3 yearly report uploads but failed on the 4th. I am busy looking at why. My workflow assumed that the 1st popup was always with no checkbox and then the following ones were always with a checkbox. More testing needed as this assumption may be wrong.
There is no specific order to it. If your browser session is active, the popup with the checkbox will show up every third time.
We have to look for both and then come up with a final assertion.
popup1 = (look for popup1 using selector 1, ContinueOnerror set to true)
popup2 = (look for popup2 using selector 2, ContinueOnerror set to true)
if popup1 = false and popup2 = false then Throw exception, restart process.
if popup1 = true get the message using selector 1
if message = success great!
else reportupload failed!!!
if popup2 = true then get message using selector 2
if message = success great!
else reportupload failed!!!