LeanFT と Java: Docker コンテナーでテストを実行する 私の Java ベースの LeanFT テストは、IntelliJ、JUnit、および LeanFT を使用してローカル マシンで正常に動作しています。
Chrome が開き、テストが実行され、すべて問題ありません。
これらのテストを Docker コンテナで実行したいと考えています。
私のテストが単純なナビゲーションのみを行う場合、すべて問題ありません。
@test
public void simpleTest2() throws GeneralLeanFtException {
browser.navigate("https://www.google.com");
}
Docker が起動し、LeanFt ライセンスを取得して、テストを実行します。
dev@ubuntu:~$ docker run -p 5900:5900 -v /home/dev/development/tempprojects/LeanFT_1/target:/tests --env LFT_LIC_SERVER=S021000105693b.adr.admin.ch --env LFT_LIC_ID=10594 --env RUN_MODE=junit --env RUN_CMD=ch.admin.bit.LeanFtTest -t -i -w /tests functionaltesting/leanft-chrome
LeanFT runtime engine started successfully
License: Concurrent UFT Enterprise Concurrent User
Port: 5095
Version: 14.3.546, (c) Copyright 2015 EntIT Software LLC
Installation Folder: /opt/leanft
Executing junit test: ch.admin.bit.LeanFtTest
JUnit version 4.12
.
Time: 5.778
OK (1 test)
LeanFT runtime engine has stopped successfully
問題:
WebElement をテストに追加しても機能しません (IntelliJ では LeanFT-Runner で機能します)。
このようなもの:
Menu dEFRITENMenu = browser.describe(Menu.class, new MenuDescription.Builder()
.accessibilityName("")
.id("")
.role("menu")
.tagName("UL")
.index(1).build());
dEFRITENMenu.select("EN");
エラーは次のとおりです。
1) simpleTest(ch.admin.bit.LeanFtTest)
com.hp.lft.sdk.ReplayObjectNotFoundException: Cannot identify the object "Web Menu".
Verify that this object's properties match an object currently displayed in your application.
at com.hp.lft.sdk.internal.ReplayExceptionFactory$1.create(ReplayExceptionFactory.java:34)
at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:197)
at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:21)
at com.hp.lft.sdk.internal.TestObjectExecuterBehaviorBase$ReplayErrorHandler.onError(TestObjectExecuterBehaviorBase.java:65)
at com.hp.lft.sdk.internal.CommunicationClientImpl.handleError(CommunicationClientImpl.java:221)
at com.hp.lft.sdk.internal.CommunicationClientImpl.send(CommunicationClientImpl.java:96)
at com.hp.lft.sdk.internal.TestObjectExecuterBehavior.executeMethod(TestObjectExecuter.java:33)
at com.hp.lft.sdk.internal.TestObjectBase.executeMethod(TestObjectBase.java:119)
at com.hp.lft.sdk.internal.web.WebMenu.access$100(WebMenu.java:14)
at com.hp.lft.sdk.internal.web.WebMenu$2.invoke(WebMenu.java:52)
at com.hp.lft.sdk.internal.TestObjectOperationWrapper.executeWithEvents(TestObjectOperationWrapper.java:81)
at com.hp.lft.sdk.internal.TestObjectOperationWrapper.executeWithEvents(TestObjectOperationWrapper.java:102)
at com.hp.lft.sdk.internal.web.WebMenu.select(WebMenu.java:56)
at ch.admin.bit.LeanFtTest.simpleTest(LeanFtTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77)
at org.junit.runner.JUnitCore.main(JUnitCore.java:36)
アイデアや実行例はありますか?