Closed zcervink closed 2 years ago
Update: I tried to read the value from there, it is possible:
ComboBoxFixture comboBoxFixture = comboBox(byXpath("//div[@class='ComboBox']"), Duration.ofSeconds(10));
comboBoxFixture.selectedText()
Update I made it working, it looks like it needs an extra click to make it work with some combo boxes:
ComboBoxFixture comboBoxFixture = comboBox(byXpath("//div[@class='ComboBox']"), Duration.ofSeconds(10));
if (!comboBoxFixture.selectedText().contains(buildTool.toString())) {
comboBoxFixture.click();
comboBoxFixture.selectItem(buildTool.toString());
}
To be completely clear this issue appear in the intellij-quarkus extension in New Project creation wizard (custom page):
My suggestion is that items in combobox model load lazily after the first combobox menu open. So I think I'll add this click when the item is not found.
additional click now supported in ComboBoxFixture
@nizienko We should reopen this issue - I have tested the RR version 0.11.8 and the fix works only for the selectItemContains() method, not for the selectItem() method. If I run the click() before the selectItem(), everything is ok. Maybe the resolution to this issue would be move the newly added if from the selectItemContains() and replace the if in selectItem() (only one proper if would be sufficient because selectItemContains() calls selectItem() or selectItem() could be called directly).
timeout
java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:232)
at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:204)
at com.intellij.remoterobot.client.IdeRobotClient.execute(IdeRobotClient.kt:63)
at com.intellij.remoterobot.JavaScriptApi$DefaultImpls.runJs(JavaScriptApi.kt:57)
at com.intellij.remoterobot.RemoteRobot.runJs(RemoteRobot.kt:32)
at com.intellij.remoterobot.fixtures.Fixture.runJs(Fixture.kt:92)
at com.intellij.remoterobot.fixtures.Fixture.runJs$default(Fixture.kt:85)
at com.intellij.remoterobot.fixtures.ComboBoxFixture$selectItem$1.invoke(ComboBoxFixture.kt:38)
at com.intellij.remoterobot.fixtures.ComboBoxFixture$selectItem$1.invoke(ComboBoxFixture.kt:34)
at com.intellij.remoterobot.stepsProcessing.StepWorkerKt.step(StepWorker.kt:23)
at com.intellij.remoterobot.fixtures.ComboBoxFixture.selectItem(ComboBoxFixture.kt:34)
@nizienko I can confirm that this fix does not work for "selectItem(...)". Workaround still required.
I have used the comboBox() successfully several times for "JComboBox" -
comboBox(byXpath("//div[@class='JComboBox']"), Duration.ofSeconds(10));
When trying to implement it for custom pages in New Project wizard for "ComboBox", it does not work:
comboBox(byXpath("//div[@class='ComboBox']"), Duration.ofSeconds(10)).selectItemContains(...........);
I have trie to change it, does not work too:
comboBox(byXpath("//div[@class='JComboBox']"), Duration.ofSeconds(10)).selectItemContains(...........);