Forum Discussion

mika_turpeinen_1's avatar
mika_turpeinen_1
New Contributor
11 years ago

How to add "[Enter] (Fail error for case is Window is invisible)

I am giving Excel file as an input for data-driven test. Excel file is very simple, only 1 column with 3 rows to keep test simple.



The value(s) ordnrr (as order number) is read in but I am not able to make an [Enter] after the value is in. This causes ofcourse that the order never jumps to the next one.

Test case error is :Error is Windows is invisible)



ORIGINAL KEYWORD TEST

Edit    Keys    "U38158[Enter]"    Enters 'U38158[Enter]' in the 'Edit' object.

# as far as I have learned the [Enter] does a keyborad command "press enter"



DATA-LOOP



Edit    Keys    Variables.Var1("tilnro")    Enters KeywordTests.Test2.Variables.Var1("ordnr") in the 'Edit' object

# Here I can see that the [Enter] as "simulate press enter from keyborad "is missing.

I tried to add an extra Edit Keys "[Enter]" step but it does not help.

- (I would had been too easy like that I guess :-)



Thanks in advance



Mika Turpeinen

2 Replies

  • nebti_nassim's avatar
    nebti_nassim
    Occasional Contributor
    Just to be sure, you didn't use quote when you were instantiating "U38158[Enter]" ?

    If it's the case then your error can come from this, when using the Keys method, you should just enter the value of your Keys actions without quotes or anything else or it will take your keys action as the string to enter and not the action.



    Hope it will help,



    Nassim



  • Hi Nassim



    ORIGINAL KEYWORD TEST

    Edit    Keys    "U38158[Enter]"    Enters 'U38158[Enter]' in the 'Edit' object.


    - this works fine and is the original captured data from recording. I have not added

    the [Enter] here myselff but as mentioned, it is from the recording. And makes the

    "Enter" happen in the screen just like pressed from keyboard.



    Check your self: If you make a Keyword test and use "Enter" or "Tab" they will appear as

    Edit3    Keys    "[Tab]"    Enters '[Tab]' in the 'Edit3' object.

    Edit4    Keys    "[ENTER]"    Enters '[Tab]' in the 'Edit4' object.



    Erasing the "-markers before and ater [] will cause an Exception Error



    Mika