I’m working with a litle automation with an excel users list with 1500 users. I’m trying to extract user_id from a web page using the email contained in excel file.
This first step is almost already (read excel…create dataTable, and I’ve captured the user id.
But in some cases the email is not found in the web page.
How can I control this?. instead of scrap user id page won’t show registers ,so The idea if the email is not found save the excel column corresponding of user id a message and continue searching.
1)Extract Email ID from Web page into strEmailID String Variable
IF(String.IsNullOrEmpty(strEmailID)
{
Assign strEmailID = “Email ID not found for this user”
}
else {
** DO NOTHING **
}
3) Add to your datarow, the above variable. In that way, you get either the Real email ID or the message.
Hope this is what you are looking for. Else let me know.
No worries, I will help you.
I think some other ui element(may be span element) laying on top of the particular UID you are trying to access. Please use the Ui Explorer and find out the exact element from the visual tree
Kindly check once whether the element (user_id) you are looking does exist. If it exists you can get them and update in place wherever you want to. This can be done with “ELEMENT EXISTS”. Find the stable element near to userid which occurs whenever you get the userid, take that as the element and add it to element exists. If it appears we have output as true and we can get the userid by using get text as you did now, else if it its false update as “It as not available”. The advantage of using this is your workflow wont get stopped even when ui element is not able to be found.
one more kind suggestion with selectors. Please dont use id - index with selector, while you are trying to fetch data, because index may change from time to time, better use aaname attribute and table attribute in the selector.
The when user_id is found, appears in aaname and innertext properties, but, how can do this selection (aaname for example) take different values, or the empty value when doesn’t find nothing
I’ve reviewed and the element user_id , and exist. In fact It has been saved returned in the excel file.
but when data not found, the selector must be nulll or empty, but simply shows me an error.
I didn’t understand at all the second suggestion. Well I understand, but I don’t know how to do it.
I’ve marked the aaname and tablerow attributes, but it hasn’t work
Great. Lets do one thing. instead of expecting the selectors to be null or be with value, we will take the error message that occurs whenever no user id is found (the screenshot you mentioned when no user id found), because our ultimate aim is to continue with the process when no data is found.
So, kindly select the text that occurs when no user id is found using “element exist” or use “Image exist” if you are not able to select them as element.If that element or image exists, i.e., if no data is found, will update accordingly in excel else will update with the userid. This can be done inside the if condition. lets try this.
@Francisco_Morales, Palaniyappan has a good idea. That makes sense for me. You can either try for his idea and if not working please try the below approach.
After entering the Email Id in the website; use a Find Child Activity over the main table element(In the Filter property provide the expression to retrieve only the table row elements). This activity will give you a list of child elements of the table element.
Get the count of the table row element
If the table row count is more than zero you can use Get Attribute Activity and input the first child element and retrieve the “aaname” attribute. Which will have your User ID
If not rows found, you can write to the excel that no User Id found.
I understand the logic. but is different when i try in the software jeje.
I’ve used Find children activitie and I had tried to show in a message box the table’s children. Always count 2 (when find or not find the user id shows 2 rows)
Kindly keep all the activities inside the container “Attach Browser” for the sequence within THEN Block in IF condition. And again dont use id as attribute for the tag, use aaname as attribute and use wildcard for the same as value, since it is dynamic in nature.
I’m looking the following situation:
When email doesn’t found, the proccess should go to Else branch, but itsn’t do.
Although if email is found or not found goes to “then” condition in the if. I don’t know how to continue
I’ve setted continueOnError in true. The rutine doesn’t stop, but capture data with errors.
existing users it save as “not found” also It repeats user_id when save in excel