Forum Discussion

Raj_Qa's avatar
Raj_Qa
Contributor
14 years ago

Unable to use a text box

I am trying to enter some text in a text box, these are the scripts I have tried to use to get to that object, but nothing seems to work



  set page= sys.process("firefox").waitpage("*LeadRoutingRule*", 5000)

  page.Wait

  set all=page.document.all

  'enter test rule as the rule name

  1.set object= page.nativewebobject.find("class", "TC_TitleInputBox")

  2.set object= all.item("Title")

 3.call a2



  object.SetText("TestAutomation")

------------------------------------------------------------------------

function a2

      Set page = Sys.Process("firefox").Page("*")

      page.wait

    set all=page.document.all

      ' Call the function

 obj = page.EvaluateXPath("(//DIV[@class='formsection hilite-region']//INPUT[@id='Title'])[1]")

    ' Check the result

    If VarType(obj) <> varNull Then

      ' If the element was found, click it

    obj(0).Click ' Note we refer to the array item



      

    Else

      ' If the element was not found, post a message to the log

      Log.Message "The element was not found"

    End If



end function





1,2,3 those are the 3 different ways i could get to the object, and none of them worked.

5 Replies

  • I am using TC 8.7 with FF7.

    I wonder if this is a bug in testComplete, the object browser for this object shows a different name, than what the source code has. I have had this problem earlier, TC is naming the object Edit(0), and is unable to use any of the properties from the source code.

    I hope someone has an answer for this.
  • Hi Raj,



    From your Object Spy screenshot, I see that TestComplete uses UI Automation and MSAA identification for web page elements instead of web identification. This can be the reason of the web search functions' failing to find the web element.

    To resolve the issue, follow the steps below:

    * Download and install the latest Firefox support patches from here.

    * Make sure that the Firefox Support Plug-in is selected in File > Install Extensions.

    * Go to Tools > Current Project Properties > Open Applications > General and move NativeFirefoxObject above NativeUIAObject and NativeMSAAObject.



    Let me know how this works for you.
  • Helena,



    I looked at  Tools > Current Project Properties > Open Applications > General  and NativeFirefoxObject was already above NativeUIAObject and NativeMSAAObject. Not sure how else do i make Testcomplete to use Web identification instead of UI Automation and MSAA identification.



    I had the latest Firefox support patches installed, but that made Testcomplete crash very often. I had submitted all the data to the support team for that issue, it was stopping me from running my tests so I had to uninstall the latest firefox support patches and latest versions of Firefox (10) using FF8 right now.
  • Hi Raj,



    You can disable MSAA and UI Automation if you don't use them in your test project. To do this, go to:

    Tools > Current Project Properties > Open Applications > MSAA

    Tools > Current Project Properties > Open Applications > UI Automation

    and uncheck the object classes to which you don't want MSAA and UI Automation identifications to be applied. The * item means "all objects".



    Does this fix the issue?
  • I have made the changes that you had suggested, However I will not be able to say if its working right away, I will definitely reply back in a week to let you know if it worked out.

    Appreciate your suggestions.