locked
HtmlEdit Box Not present But showing Exists as True

    Pregunta

  • Hi All,

    HtmlEdit box with given id is not present on the browser but below exists statement show true. Amazing............

    Dim CUITBrowserWindow as UITestControl

    CUITBrowserWindow.TechnologyName="Web"

    CUITBrowserWindow.SearchProperties.Add(New PropertyExpression(UITestControl.PropertyNames.Name, "ABC", PropertyExpressionOperator.Contains))

    Dim

     

     

    htmldoc As New HtmlDocument(CUITBrowserWindow )

    htmldoc.TechnologyName =

     

    "Web"

    htmldoc.SearchProperties.Add(

     

    HtmlDocument.PropertyNames.Title, "ABC")

     

     

    Dim edit As New HtmlControls.HtmlEdit(htmldoc)

    edit.TechnologyName =

     

     

    "Web"

    edit.SearchProperties.Add(HtmlControls.

     

    HtmlEdit.PropertyNames.Id, "Vijay")

    If edit.Exist then

    msgbox "Correct"

    Else

    msgbox "Fail"

    End IF

    Please let me know if went wrong anywere.

    miércoles, 22 de diciembre de 2010 12:08

Todas las respuestas

  • I have come across similar incident.  After investigating, I found out that the my control was actually exist on the page.  It was not seen on the page because it was hidden.

    you check whether the control is exist.... it may be exist but hidden...

    Yours may be the same mine. You can try to verify by right-click on your page then click on "view source" then search for your control.  see if there is hidden attribute.

    miércoles, 22 de diciembre de 2010 18:53
  • First, disable Smart Match algorithm (i had some issues long time ago because of it: http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/ddf50fd4-d788-4333-8cf1-0cc2f3941fd3/):

    Playback.PlaybackSettings.SmartMatchOptions = SmartMatchOptions.None;

    After that try again to see if the Exist method return true.

    If it is still returning true, in IE, use Internet Explorer Toolbar (open it) and check how many textboxes with the id "Vijay" exists in the page. If it is just only one, and the Smart Matching Algorithm is disable, than there is a problem (until now, I didn't meet such issues with the Smart Algorithm Disabled). In this case, just post the page source and the object definition (like in your previous example).

    miércoles, 22 de diciembre de 2010 19:05
  • Thanks Silviu Luca. Its working fine after applying Playback.PlaybackSettings.SmartMatchOptions = SmartMatchOptions.None setting.

     

    jueves, 23 de diciembre de 2010 9:21