运行“ Altunity Tester”要在编辑模式下测试Unity应用程序:无法连接到主机上的Altunity Tester:127.0.0.1端口:13000?
这是第一次,我正在运行 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");
}
}
请让我知道如何解决此错误?谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您说自己在编辑模式下运行时,您的意思是按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