How can i enter text in a text box when i dont have automaionID and Name in UISpy of the text box

Oct 26, 2012 at 9:11 AM
Edited Oct 26, 2012 at 9:27 AM

 

I need to enter text under Adressline1 textbox but i dont have AutomationID & name of the text box in UI Spy

 

i had gives screen shots below.

 

please reply me if you know the solution

 

 

 

AutomationElement
  General Accessibility
    AccessKey:    ""
    AcceleratorKey:    ""
    IsKeyboardFocusable:    "False"
    LabeledBy:    "(null)"
    HelpText:    ""

  State
    IsEnabled:    "True"
    HasKeyboardFocus:    "False"

  Identification
    ClassName:    "Text"
    ControlType:    "ControlType.Text"
    Culture:    "(null)"
    AutomationId:    ""
    LocalizedControlType:    "text"
    Name:    "Address, Line1"
    ProcessId:    "5572 (VisionClient)"
    RuntimeId:    "7 5572 44318255"
    IsPassword:    "False"
    IsControlElement:    "True"
    IsContentElement:    "True"

  Visibility
    BoundingRectangle:    "(42, 155, 82, 16)"
    ClickablePoint:    "83,163"
    IsOffscreen:    "False"

ControlPatterns

 

AutomationElement
  General Accessibility
    AccessKey:    ""
    AcceleratorKey:    ""
    IsKeyboardFocusable:    "True"
    LabeledBy:    "(null)"
    HelpText:    ""

  State
    IsEnabled:    "True"
    HasKeyboardFocus:    "False"

  Identification
    ClassName:    "TextBox"
    ControlType:    "ControlType.Edit"
    Culture:    "(null)"
    AutomationId:    ""
    LocalizedControlType:    "edit"
    Name:    ""
    ProcessId:    "5572 (VisionClient)"
    RuntimeId:    "7 5572 48570174"
    IsPassword:    "False"
    IsControlElement:    "True"
    IsContentElement:    "True"

  Visibility
    BoundingRectangle:    "(42, 173, 311, 24)"
    ClickablePoint:    "197,185"
    IsOffscreen:    "False"

ControlPatterns
  Scroll
    HorizontalScrollPercent:    "-1"
    HorizontalViewSize:    "100"
    VerticalScrollPercent:    "-1"
    VerticalViewSize:    "100"
    HorizontallyScrollable:    "False"
    VerticallyScrollable:    "False"

  Text
    DocumentRange
      Text:    ""
      Length:    "0"
      Bounding Rectangles:    ""
      AnimationStyleAttribute:    "None"
      BackgroundColorAttribute:    "0"
      BulletStyleAttribute:    "FilledRoundBullet"
      CapStyleAttribute:    "None"
      CultureAttribute:    "en-US"
      FontNameAttribute:    "Segoe UI"
      FontSizeAttribute:    "9"
      FontWeightAttribute:    "400"
      ForegroundColorAttribute:    "4210752"
      HorizontalTextAlignmentAttribute:    "Left"
      IndentationFirstLineAttribute:    "0"
      IndentationLeadingAttribute:    "0"
      IndentationTrailingAttribute:    "0"
      IsHiddenAttribute:    "False"
      IsItalicAttribute:    "False"
      IsReadOnlyAttribute:    "False"
      IsSubscriptAttribute:    "False"
      IsSuperscriptAttribute:    "False"
      MarginBottomAttribute:    "0"
      MarginLeadingAttribute:    "0"
      MarginTopAttribute:    "1.5"
      MarginTrailingAttribute:    "3.75"
      OutlineStylesAttribute:    "None"
      OverlineColorAttribute:    "0"
      OverlineStyleAttribute:    "None"
      StrikethroughColorAttribute:    "0"
      StrikethroughStyleAttribute:    "None"
      TabsAttribute:    "(not supported)"
      TextFlowDirectionsAttribute:    "Default"
      UnderlineColorAttribute:    "0"
      UnderlineStyleAttribute:    "None"

  Value
    Value:    ""
    IsReadOnly:    "False"

Oct 26, 2012 at 9:56 AM

Hi

what is with the parent of the Textbox (the same as Address, Line1) ?

Contains the parent other TextBoxes with the same empty elements?

 

if not try.

TextBox box = parent.Get<TextBox>(SearchCriteria.ByAutomationId("").AndByText(""));

 

this is notnice but may help. If you test software from your own company andhas access to the developer, ask him to add AutomationId.

(only WPF)

Other way if many Textboxes with the same id/name exists in the same parent :

IUIItem[] items = parent.GetMutiple(SearchCriteria.ByControlType(ControlType.Edit));

and use the index of the array.

OR

AutomationElementCollection coll = parent.AutomationElement(new PropertyCondition(AutomationElement.ControltypeProperty(ControlType.Edit)));

List<TextBox> boxes = new List<TextBox>();

foreach(AutomatonElement el in coll)

{

  boxes.Add(new TextBox(el, parent.ActionListener));

}

 

 

 

Oct 26, 2012 at 10:13 AM

The parent of the text box is the same as "Text" Address Line1, it have name as "Address, Line1" but dont have Automation ID

Identifiaction for Adrress Line 1

  Identification
    ClassName:    "Text"
    ControlType:    "ControlType.Text"
    Culture:    "(null)"
    AutomationId:    ""
    LocalizedControlType:    "text"
    Name:    "Address, Line1"
    ProcessId:    "5572 (VisionClient)"
    RuntimeId:    "7 5572 44318255"
    IsPassword:    "False"
    IsControlElement:    "True"
    IsContentElement:    "True"

Oct 26, 2012 at 10:19 AM

we had tried below one

TextBox box = calcwindow.Get<TextBox>(SearchCriteria.ByText("Address, Line1");

box..BulkText = "eswar";

 

but its not working

Oct 26, 2012 at 11:04 AM

 

Hi,

the below one is working for us but we have few more text boxes on same page.how can we insert text text in to them,they also dont have AutomationID & Name

           //Insert Address Line1           
           
          //This one is working

            TextBox tbAL1 = VisionWindow.Get<TextBox>(SearchCriteria.ByAutomationId("").AndByText("")); 
            tbAL1.BulkText = "WhiteClient"; 

            //This One iS not working
            //Insert City 
            TextBox tbCity = VisionWindow.Get<TextBox>(SearchCriteria.ByAutomationId("").AndByText("")); 
            tbCity.BulkText = "WhiteClient";

Oct 26, 2012 at 11:49 AM

Try to use Window.getMultiple which will return all textboxes and then work by index.

Note: i have not tried. But i have read in some post earlier.

Oct 26, 2012 at 12:11 PM

Hi,

Can you share the post details

Oct 26, 2012 at 12:41 PM

u can find below link

 

http://white.codeplex.com/discussions/399807