Forum Discussion

rgratis's avatar
rgratis
Frequent Contributor
11 years ago

Issues entering values into text fields in Chrome (Keys method)

I am having a very odd issue with TestComplete 10.0.531.7 and Chrome 33.0.1750.154 m.  If the cursor is in the browser address bar, any Keys input goes into the address bar, even when I am directly sending the Keys command to a certain text field object.



Example using the Functional Web Testing forum page search bar:




Call Sys.Browser("chrome").Page("http://smartbear.com/forums/f75/functional-web-testing/").Form("form").Panel("container").Panel("undefined_sticky_wrapper").Panel(0).Panel(0).Header(0).Panel(1).Nav(0).Panel(2).Panel("search_small").Textbox(0).Keys("Text Entry")



Normally, running that script command puts "Text Entry" into the search bar.  If I place the mouse cursor anywhere in the Chrome address bar and run that script command, the input goes into the address bar.



This is a problem because Chrome automatically places the cursor into the address bar upon start such that my tests fail when they go to log in to our application (username and password end up in address bar of Chrome).



A workaround appears to be to have my test click the username field before trying to enter text, but this seems like a bug to me since I'm targetting the text field object for the Keys command and not just sending Keys to the desktop.



This behavior is not exhibited in IE11 or Firefox 27.  If I place the cursor into the address bar and then call a Keys command on the text field, the text is entered into the right field.

  • Hi Rachel,


     


    Our R&D team was able to reproduce the issue - they are going to fix it in the nearest product update. 


    If this issue is critical for you, please contact our TestComplete Support team - they will try to find a workaround or consider the possibility of creating a patch.


     


    Sorry for the inconvenience.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Rachel,


     


    Our R&D team was able to reproduce the issue - they are going to fix it in the nearest product update. 


    If this issue is critical for you, please contact our TestComplete Support team - they will try to find a workaround or consider the possibility of creating a patch.


     


    Sorry for the inconvenience.

  • rgratis's avatar
    rgratis
    Frequent Contributor
    Thanks, Tanya!



    As a workaround, I add a step to our test setup routine that clicks within our home page to move the cursor out of the address bar.  This allows the tests to continue as normal.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Something to investigate...  TestComplete 10.0 doesn't list documented support for Chrome 33.  That's documented in TestComplete 10.10.  It's possible that what you're experiencing is due to an unsupported browser version.  



    This is just a guess, mind you, but it seems to be the first track to make sure of.  If you can, try upgrading to the latest release of TestComplete and see if the problem persists.
  • rgratis's avatar
    rgratis
    Frequent Contributor
    Exact same issue when using TestComplete 10.10.752.7, so that is not the problem.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Rachel,


     


    TestComplete 10.10 and Chrome 33 are installed on my computer - everything works ok.


    Does this issue happen on any pages or only the one you are testing?


     

  • rgratis's avatar
    rgratis
    Frequent Contributor
    This appears to be an issue with all pages opened in the web browser until I perform some action that removes the cursor from the address bar.



    Here's a simple VBScript test using the SmartBear forums that fails on my system.  The string "Text Entry" ends up in the address bar and not the search bar text field on the page.




    Sub Test


     


      Do While Sys.WaitBrowser("chrome", 0).Exists


        Call Sys.Browser("chrome").Close()


      Loop


      


      Call Browsers.Item(btChrome).Run("http://smartbear.com/forums/f75/functional-web-testing/")


      



     


    End Sub 'Test

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,


     


    Thanks for sharing your workaround with us.


    I hope this inconvenience is temporary. 


     

  • oleg_sigalov's avatar
    oleg_sigalov
    Occasional Contributor


    Hi,



    I'm trying to migrate from IE to Chrome.


    "Keys" method doesn't work in Chrome, but in IE it work fine.


    I can workaround with setText method, but I don't want because it will take many code changes.


     


    My workspace:


    Chrome version:Version 37.0.2062.103 m


    TestComplete Version: 10.30.1303.7


    Windows 7 64bit


     


    You can reproduce with "Email" filed on "http://1756201.qakmstest.dev.kaltura.com/user/login/" page

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Oleg,

     


    Could you please describe in detail what exactly doesn't work? If you get any error, post its text here.


     


    I've tried to add some text to the User ID field (I didn't see the Email field) with the Keys method - it was successfully entered.