반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Tags
more
Archives
Today
Total
관리 메뉴

개발꿈나무

[RPA] Power Automate Desktop - Web UI를 오른쪽 마우스 클릭해야할 경우 본문

RPA

[RPA] Power Automate Desktop - Web UI를 오른쪽 마우스 클릭해야할 경우

HYOKYE0NG 2021. 8. 25. 10:15
반응형

RPA로 업무 자동화 프로세스를 개발하던 중 오른쪽 마우스 클릭을 해야하는 상황이 생겨 매우 끙끙 앓았다. 며칠동안 삽질을

하고 겨우겨우 해결했다. 추후 이런 상황에 또다시 마주칠 수도 있는 미래의 나를 위해 포스팅 하는 글.

 

며칠 간의 구글링을 통해 겨우 찾은 reference

 

Get the coordinates and size of a web element - Power Automate

Get the coordinates and size of a web element

docs.microsoft.com

 

Web UI - Right Mouse Click

 

Web UI가 아닌 일반 UI의 경우는 창의 UI 요소 클릭 Action에서 클릭 유형을 지정할 수 있다. 왼쪽, 오른쪽, 더블, 중간 등등

진짜 다양하게 있다. 그거 좀 Web UI한테 나눠주지,,,,,,

UI 자동화 - 창의 UI 요소 클릭 action

 

 

그러나, 내가 해야할 것은 Web UI를 오른쪽 클릭하기,,,,, 진짜 삽질 오질나게 하고 구글 진짜 많이 뒤졌다. Power Automate는 Reference가 너무 없다. 진짜 힘들다 힘들어~~~~~

 

 

결론만 먼저 간단하게 말하자면 아래의 flow와 같다. 이것도 구글링 하다 어떻게 발견한 것이었는데

사실 waelementractangle이 어떤 데이터를 가져오는지는 정확히 모르겠지만 내 생각을 펼쳐보자면,

 

Web UI의 위치 정보를 가져와서 list에 저장하는데 이 때 위치 정보가 text로 저장되어 있기 때문에 foreach를 돌리면서 text를 숫자로 변환하여 다시 저장한 후 이 데이터를 이용하여 마우스를 Web UI요소의 위치로 이동시킨 후 오른쪽 마우스 클릭을

보내는 로직이다.

 

List에 저장된 숫자들의 의미를 파악해보자면 타이핑하기 귀찮으니까 MS document에서 긁어올랭

 

 

To access the final coordinates and size values later in your flow, use the following notations:

  • List[0] - The left point of the web element, relative to the top left corner of the HTML page
  • List[1] - The top point of the web element, relative to the top left corner of the HTML page
  • List[2] - The width of the web element
  • List[3] - the height of the web element

To calculate the right and bottom points of the window, you can use the following expressions:

  • %List[0] + List[2]% - The right point of the web element
  • %List[1] + List[3]% - The bottom point of the web element

 

To find the coordinates of the top left corner of an HTML page, you can use the web browser's instance properties DisplayRectangleX and DisplayRectangleY.

After storing a browser's instance into a variable named %Browser%, use the %Browser.DisplayRectangleX% and %Browser.DisplayRectangleY% expressions to retrieve the X and Y dimensions.

 

 

나는 활성창의 시작점에서부터 Web UI의 위치를 더한 좌표로 마우스를 이동시켰다.

 

 

파란만장한 Web UI right mouse click 여기서 끝!

 

 

 

 

보너스로,,,, 키보드와 마우스를 동시에 클릭해야하는 상황도 있었는데 이거는 생각보다 간단하게 해결되었다.

그냥 Shift key 누르고 클릭 보내고 Shift key 해제하기 !

 

 

 

<Reference>

 

웹 요소의 좌표 및 크기 가져오기 - Power Automate

웹 요소의 좌표 및 크기 가져오기

docs.microsoft.com

 

 

웹 요소에 대한 물리적 클릭 보내기 - Power Automate

웹 요소에 대한 물리적 클릭 보내기

docs.microsoft.com

 

반응형
Comments