Forum Discussion

ASV's avatar
ASV
Contributor
13 years ago

Press '+' button

Hi

I want to press '+' button,

I write obj.keys("+"), but it doesn't work, also I write obj.keys("[+]") it don't work too.

How I can press '+' button.

Thanks 
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Using the calculator as a test, I was able to use .Keys("+") to use the plus key that appears on the main keyboard and .Keys("[NumPlus]") to select the plus that goes with the number pad.



    When you say that it doesn't work, what are you expecting to happen that is not happening?  Are you getting error messages?

  • Hi Vahagn,





    You can try the following approaches:







    //...

    obj.Keys("[NumPlus]");

    //or:

    obj.Keys("!="); 

    //or:

    obj.Keys("[X107]");

    //...







    For additional information, please see the "Keys Action" help topic.





    If the recommendations above do not help, please clarify the problem. What object (obj) are you referring to? What code is generated by TC when you record your actions? If you get some error messages during the playback, please send us screenshots demonstrating the errors. 





    Also, to troubleshoot the issue, run Notepad and execute the code below:





     

    function TestNotepad() 

    {

      var Edit;

      Edit = Sys.Process("notepad").Window("Notepad", "*").Window("Edit");

      Edit.Keys("+");

      Edit.Keys("[NumPlus]");

      Edit.Keys("!="); 

      Edit.Keys("[X107]"); 









    Does this script work properly?





    Let me know your results.


  • ASV's avatar
    ASV
    Contributor
    Thanks.

    I test an exe that open the window, which thousands of rows. I need to select all rows. I can do that pressing the button '+'(not 'Shift =', the other). Now it works, when i write obj.Keys("[x107]") or obj.Keys("[NumPlus]").