Is the old Input System supported?

44 views
Skip to first unread message

Alexis Navarro

unread,
Nov 9, 2022, 6:58:38 AM11/9/22
to AltTester - UI test automation tool for gaming
I've written a simple test where I'm trying to simulate key-presses on an input field, but it's not typing any text. I'm not sure if I'm doing something wrong or if it's because AltTester doesn't support the old input system.

Note: I'm aware that SetText() exists and it does work fine. I just want to try AltTester's input simulation out.

Alexandru Rotaru

unread,
Nov 9, 2022, 10:27:36 AM11/9/22
to Alexis Navarro, AltTester - UI test automation tool for gaming
Hi Alexis,

Yes, we support the old input system and PressKey and PressKeys should still work. Do you get any errors when you call the methods? 
We have several examples online that you can check - if those are running on your system, then it's something with your tests or the application that your work with...

Thanks,
Alex

On Wed, Nov 9, 2022 at 1:58 PM Alexis Navarro <alexisn...@gmail.com> wrote:
I've written a simple test where I'm trying to simulate key-presses on an input field, but it's not typing any text. I'm not sure if I'm doing something wrong or if it's because AltTester doesn't support the old input system.

Note: I'm aware that SetText() exists and it does work fine. I just want to try AltTester's input simulation out.

--
You received this message because you are subscribed to the Google Groups "AltTester - UI test automation tool for gaming" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alttesterforu...@altom.com.
To view this discussion on the web visit https://groups.google.com/a/altom.com/d/msgid/alttesterforum/3f97e27c-56be-42d6-826d-a5cf827c4cean%40altom.com.


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

Alexandru Rotaru

Alexis Navarro

unread,
Nov 10, 2022, 1:01:26 PM11/10/22
to AltTester - UI test automation tool for gaming, alex....@altom.com, AltTester - UI test automation tool for gaming, Alexis Navarro
The Move() function for the PlayerController is simple:

private void Move()
    {
        var rigidbody = gameObject.GetComponent<Rigidbody>();
        rigidbody.AddForce(new Vector3(Input.GetAxis("Horizontal") * 8, 0, Input.GetAxis("Vertical") * 8), ForceMode.Force);
    }

Then on the test I'm doing this:

    [Test]
    public void PlayerMoves()
    {
        var player = api.FindObject(By.NAME, "Player");
        var playerInitialPosition = player.getWorldPosition();
        api.PressKey(AltKeyCode.UpArrow, 1, 3, true);
        api.PressKey(AltKeyCode.W, 1, 3, true);
        Assert.AreNotEqual(playerInitialPosition, player.getWorldPosition());
    }

The test finishes ultra fast, without waiting for the 3-second keypresses and the player remains in the same position (the assertion fails).
Any idea of what's the cause?

Alexandru Rotaru

unread,
Nov 14, 2022, 4:54:15 AM11/14/22
to Alexis Navarro, AltTester - UI test automation tool for gaming
Hi Alexis,

I think the problem that you are facing is related to issue #967 (was confirmed last week and is currently in code-review) and issue 974. Our plan is to have a hotfix release for these issues, plus a few other ones. 

I hope this brings more light into the behavior that you experienced.

Thanks,
Alex

Alex

Alexis Navarro

unread,
Nov 16, 2022, 7:16:38 AM11/16/22
to AltTester - UI test automation tool for gaming, alex....@altom.com, AltTester - UI test automation tool for gaming, Alexis Navarro
I tried changing to the new input system and now the keypresses work, but I'm observing another problem: the tests are running asynchronously and in parallel. Meaning that all tests run at the same time, and each test runs through all the lines of code at once, without waiting for input simulation to finish. For example api.PressKey(AltKeyCode.UpArrow, 1, 3, true) should wait for 3 seconds before moving to the next line, correct? That's not happening. As a result, the Assert is called before the player object even starts moving in response to the keypress. I explicitly set api.SetDelayAfterCommand(3) and the results are the same. Any idea why?

The curious part is that the test runner only finishes after the movement completes.


Alexis Navarro

unread,
Nov 16, 2022, 7:20:16 AM11/16/22
to AltTester - UI test automation tool for gaming, Alexis Navarro, alex....@altom.com, AltTester - UI test automation tool for gaming
Or perhaps they're actually not running in parallel, but simply running all the code at once, hence why it seems like it's in parallel. Hard to tell as it's all so fast.

Alexis Navarro

unread,
Nov 16, 2022, 7:27:09 AM11/16/22
to AltTester - UI test automation tool for gaming, Alexis Navarro, alex....@altom.com, AltTester - UI test automation tool for gaming
There's is another report of this same issue 4 months ago, which seems to remain unaddressed: https://gitlab.com/altom/altunity/altunitytester/-/issues/880

Robert Poienar

unread,
Nov 21, 2022, 2:40:41 AM11/21/22
to AltTester - UI test automation tool for gaming, Alexis Navarro, Alexandru Rotaru, AltTester - UI test automation tool for gaming
We are working on that issue(about press key not waiting), and will be fixed in the next release.
Reply all
Reply to author
Forward
0 new messages