We are doing ui automation in an SAP application. There is an inner box where a name/names of a file/multiple files appear as a result of a search by a string. We need to click on the exact name what we have searched from the inner box.
We are doing as follows:
- Using Click activity and in the selector passing the filename variable in the ‘aaname’ attribute.
- Using Click Text activity and Indicating the whole inner box and passing the file name as text.
But we observed that whenever the file name has multiple words separated by space its not able to click. Kindly help what might be the issue and how can we resolve the same ?
Can you identify the element with uiexplorer and post a screenshot of it? With the file name written in the field.
Please refer the screenshots of selector and the application.
you Can try by using,assign variable to pass the filename variable in to the click activity/click text and check the selector if any static values in aaname or inner text make it (*) instead of space of the file name.
Let me known if you need any clarification.
Thanks for your reply. Actually aaname we are passing the variable of the file name.
If we pass * then it wont work for cases where multiple options come. Like suppose FileName=“bc”. Then in the inner box if abc, bcd and bc come then it wont click on the proper option bc. So we replaced the same with variable.
But in this case single word filenames are getting clicked but not filenames with multiple words separated by space.
Is there any way to get the file name from Application using Get Text activity ?
If It’s Possible you can split the filename with Space and get the first word of filename and assign to a variable and pass the variable in aaname attribute as (YourVariable*)
Let me Known
But if we split and use only first word then how will it click in the cases of multiple options ?
If first word = ab.
And the options are ab, ab cd, cd ab etc.
@Obsev Could you provide any solution ?
There was a bug in some past version of UiAutomation library. The “Click Text” activity did not support Text argument containing any delimiter (e.g. space, dot etc.), only single word was supported.
It works with recent 20.4.2 version, but do not know in which version it was fixed.
Check if you are using the recent UiAutomation library.
As @J0ska are saying - either try update or just use a normal “click” instead of “click text”. You could also use “Find element”, which should work.
Thanks @Obsev !
The issue is with Click activity. In Click Text activity its not even working. May be the name is not in text format. (You can check my screenshot above)
And that Find Element/ Find Text/ Find Image I will give a try. Hope that works.
Yes I tried that. But its not at all reliable. Its clicking in wrong place.
Find Element - I indicated the inner box and in the innerText attribute of the selector i passed the string to be clicked. Then captured the output as uielement.
Click - Here i just passed the uielement variable.
But its clicking in wrong places.
I haven’t tried in our application though. I tried in a web page.
So i think we can’t rely on it.
I have a SAP BO system here.
I tested the “Click” activity in that system to select an item in prompt and it works okay.
Using IE, though.
I have never worked with SAP but you can also try with a different spy-mode, like AA, to see if you get other/better selectors that works better.
Now its working. Actually we replaced all the spaces with * in the variable and passed to the aaname attribute.Then it started working for all the names with single word and multiple words. We are using Click activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.