运行“ Altunity Tester”要在编辑模式下测试Unity应用程序:无法连接到主机上的Altunity Tester:127.0.0.1端口:13000?

发布于 2025-01-22 14:31:07 字数 1150 浏览 2 评论 0 原文

这是第一次,我正在运行 altunity tester 在Unity 3D中测试应用程序,但是我得到了此错误:

onetimesetup:altom.altunitydriver.connection time timeTexception:未能连接到主机上的Altunity测试仪:127.0.0.1端口:13000。

我正在以编辑器模式进行测试。

我的Unity版本是:2019.4

我的AltunityTest版本是:1.7.0(2022年1月25日)

我的计算机是MacOS。

我在wifi上跑步。


这是我在 altunity tester 中的测试脚本:

using NUnit.Framework;
using Altom.AltUnityDriver;

public class NewAltUnityTest
{
    public AltUnityDriver altUnityDriver;
    //Before any test it connects with the socket
    [OneTimeSetUp]
    public void SetUp()
    {
        altUnityDriver =new AltUnityDriver();
    }

    //At the end of the test closes the connection with the socket
    [OneTimeTearDown]
    public void TearDown()
    {
        altUnityDriver.Stop();
    }

    [Test]
    public void TestStartGame_April_19_2022()
    {
        altUnityDriver.LoadScene("Start");
        
        altUnityDriver.FindObject(By.NAME, "StartButton").Click();

        altUnityDriver.WaitForCurrentSceneToBe("Main");
    }
}

请让我知道如何解决此错误?谢谢。

This is the first time, I am running AltUnity Tester to test an app in Unity 3D, but I got this error:

OneTimeSetUp: Altom.AltUnityDriver.ConnectionTimeoutException : Failed to connect to AltUnity Tester on host: 127.0.0.1 port: 13000.

I am testing it in Editor Mode.

My Unity version is: 2019.4

My AltUnityTest version is: 1.7.0 (Jan 25, 2022)

My computer is MacOS.

I am running on Wifi.


Here is my test script in AltUnity Tester:

using NUnit.Framework;
using Altom.AltUnityDriver;

public class NewAltUnityTest
{
    public AltUnityDriver altUnityDriver;
    //Before any test it connects with the socket
    [OneTimeSetUp]
    public void SetUp()
    {
        altUnityDriver =new AltUnityDriver();
    }

    //At the end of the test closes the connection with the socket
    [OneTimeTearDown]
    public void TearDown()
    {
        altUnityDriver.Stop();
    }

    [Test]
    public void TestStartGame_April_19_2022()
    {
        altUnityDriver.LoadScene("Start");
        
        altUnityDriver.FindObject(By.NAME, "StartButton").Click();

        altUnityDriver.WaitForCurrentSceneToBe("Main");
    }
}

Would you please let me know how to fix this error ? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹微笑 2025-01-29 14:31:07

当您说自己在编辑模式下运行时,您的意思是按Altunity Tester Editor按“播放编辑器”。启动游戏时,您应该有一个绿色弹出窗口,上面写着:“等待连接端口:{您设置的端口}”

如果弹出窗口不可见,则意味着无法启动服务器,因此测试没有任何内容连接到。

您发布的测试是正确的,因此您不必担心。

另一件事可能是您要连接的端口已经使用,如果是这种情况,只需更改为另一个自由端口即可。

如果您通过以下步骤进行以下步骤,也可能会有所帮助:

When you say that you run in editor mode, do you mean that you press "play in editor" from AltUnity Tester Editor. When you start the game you should have a green popup that says: "Waiting for connection port: {the port you set}"

If the popup is not visible that means that the server is not started so the tests don't have anything to connect to.

The tests you posted is correct so you don't have to worry about that.

Another thing could be that the port you are trying to connect is already used, if that is the case just change to another free port.

Might also help if you go through the steps from: https://altom.gitlab.io/altunity/altunitytester/pages/get-started.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文