Hi,
I recently just encounter a problem where upon inserting a variable into the selector, I keep getting “element unknown” error. As seen from the bottom the original and the edited selector outputs are similar however, the edited selector is not able to work. Please help
Original selector: (able to work)
wnd app=‘iexplore.exe’ cls=‘Internet Explorer_Server’ /
uia name='Goods ’ role=‘list item’ /
Edited selector:
“wnd app=‘iexplore.exe’ cls=‘Internet Explorer_Server’ /
uia name=’ “+lineType.ToString()+” ’ role=‘list item’ /”
Editted selector output: (unable to work)
wnd app=‘iexplore.exe’ cls=‘Internet Explorer_Server’ /
uia name=’ Goods ’ role=‘list item’ /
*Disclaimer ive deleted away the <>
Yoichi
(Yoichi)
December 28, 2020, 6:42am
2
Hi,
It seems there are extra spaces ahead / behind variable.
Can you try the following?
"<wnd app='iexplore.exe' cls='Internet Explorer_Server' /><uia name='"+lineType.ToString()+"' role='list item' />"
Regards,
1 Like
Hi,
I just use your codes and for some reason it still doesnt work. It’s still giving me the same error. I am selecting this item from a dropdown.
Yoichi
(Yoichi)
December 28, 2020, 7:08am
4
HI,
Can you share content of lineType.ToString()?
If it is not "Goods "
(there is a space after the word) but "Goods"
, can you try the following?
"<wnd app='iexplore.exe' cls='Internet Explorer_Server' /><uia name='"+lineType.ToString()+" ' role='list item' />"
Regards,
Hi,
There are suppose to be 7 spaces. And I have already tried the method below. However it still giving me error
"<wnd app='iexplore.exe' cls='Internet Explorer_Server' /><uia name='"+lineType.ToString()+" ' role='list item' />"
Yoichi
(Yoichi)
December 28, 2020, 7:26am
6
Hi,
There are suppose to be 7 spaces.
For now, to isolate problem, can you try the following selector (using wild card)?
"<wnd app='iexplore.exe' cls='Internet Explorer_Server' /><uia name='*"+lineType.ToString()+"*' role='list item' />"
Even if it works, we might need to modify it in order to improve more accurate.
Regards,
jack.chan
(Jack Chan)
December 28, 2020, 7:27am
7
What error is it giving? Also the selector+variable should be pasted here in the properties
and NOT in selector editor
Hi,
Thank you so much! Now its works! What modify do I need to do tho?
Regards,
Hi,
Yup I did pasted it in the properties!
Yoichi
(Yoichi)
December 28, 2020, 7:42am
10
Hi,
If there is partial same words such as “Goods” and “Goods B”, it might not work properly. So can you try the following regex selector?
"<wnd app='iexplore.exe' cls='Internet Explorer_Server' /><uia name='\s*"+lineType.ToString()+"\s*' role='list item' matching:name='regex' />"
Regards,
If there is partial same words such as “Goods” and “Goods B”, it might not work properly. So can you try the following regex selector?
There are no same words all of them are different.
Regards,
Yoichi
(Yoichi)
December 28, 2020, 7:49am
12
Hi,
All right. Selector in #6 post will work in your case.
Regards,
system
(system)
Closed
December 31, 2020, 7:49am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.