2016-06-08 4 views
0

코딩 된 UI를 사용하여 알림 표시 줄 텍스트를 읽는 방법. 알림 표시 줄 및 알림 텍스트를 기록하지만 알림 표시 줄 텍스트를 읽을 수 없으며 알림 텍스트 강조 표시를 만들지 만 텍스트를 읽을 수 없으면 텍스트를 읽을 수 있습니까?알림 바 텍스트? 코드화 된 UI 사용?

[GeneratedCode("Coded UITest Builder", "12.0.31101.0")] 
public class UINotificationToolBar : WinToolBar 
{ 

    public UINotificationToolBar(UITestControl searchLimitContainer) : 
      base(searchLimitContainer) 
    { 
     #region Search Criteria 
     this.SearchProperties[WinToolBar.PropertyNames.Name] = "Notification"; 
     this.WindowTitles.Add("Send with Options"); 
     #endregion 
    } 

    #region Properties 
    public WinText NotificationbarTextText 
    { 
     get 
     { 
      if ((this.mNotificationbarTextText == null)) 
      { 
       this.mNotificationbarTextText = new WinText(this); 
       #region Search Criteria 
       this.mNotificationbarTextText.SearchProperties[WinText.PropertyNames.Name] = "Notification bar Text"; 
       this.mNotificationbarTextText.WindowTitles.Add("Send with Options"); 
       #endregion 
      } 
      return this.mNotificationbarTextText; 
     } 
    } 
    #endregion 

    #region Fields 
    private WinText mNotificationbarTextText; 
    #endregion 
} 

컨트롤은 우리가 올바르게 대답하는 창 Contrls이

+0

를이 내 코드입니다 : toolBar.NotificationbarTextText.Find(); string s = toolBar.NotificationbarTextText.DisplayText.ToString(); null이 반환됩니다. –

+0

녹음 및 재생 옵션의 검사기를 사용하여 캡처 할 텍스트가있는 컨트롤에 착륙 할 때까지 컨트롤 트리를 탐색 할 수 있습니다. 레코드를 켜고 재생하고, 노우 피티 티 바 위에 마우스를 놓고 Ctrl + Shift + I (대문자 i)를 누릅니다. 알림 바가 선택됩니다. 그런 다음 컨트롤 패널의 위쪽에는 위쪽, 오른쪽, 아래쪽 및 왼쪽 화살표가있는 컨트롤 탐색 아이콘이 있습니다. 이렇게하면 실제 텍스트가있는 컨트롤을 찾을 때까지 이동할 수 있습니다. – MPavlak

답변

0

당신은 거의 충분한 코드를 게시하지 않은 것입니다. toolBar는 어떤 유형의 컨트롤입니까? NotificationbarTextText에 헝가리 표기법을 사용하는 이유는 무엇입니까?

그러나, 당신은 시도 할 수 있습니다 :

toolBar.NotificationbarTextText.InnerText.ToString(); 

보다는 :

toolBar.NotificationbarTextText.DisplayText.ToString(); 
+0

안녕하세요 Ryanman, 답장을 보내 주셔서 감사합니다, 나는 또한 r을 반환하려고 생각도 코드를 시도했다. 나는 내 코드를 붙여 넣는다. 나는 알림 텍스트를 위해 녹음 한 것을 의미한다. –

+0

Surya, 나는 DisplayText와 InnerText에 관해서 틀렸다. 알림 표시 줄 객체의 UI 맵을 봅니다. 텍스트를 가져 오려고하는 요소는 WinText 개체의 자식 일 수 있습니다. 컨트롤을 올바르게 식별하면 표시 텍스트를 가져올 수 없어야하는 이유가 없습니다. – Ryanman

관련 문제