我正在使用selenium webDriver为Web应用程序编写测试,并遇到了一个场景,当我尝试关闭浏览器时,我得到一个弹出窗口"你确定吗?页面要求你确认你要离开 - 输入的数据将会迷路了." 有2个按钮:保持页面和保持页面
如何点击这些按钮?
运行我的测试时出现此错误:org.openqa.selenium.StaleElementReferenceException:元素不再附加到DOM
关于如何解决上述异常的任何想法?这发生在我的网格中,它有一个动态的ref Xpath表达式
需要获取iframe内的span的xpath表达式.在Iframe弹出窗口中获取span的XPath表达式时需要帮助.
我可以获得iframe,但在iframe中获取/ html/body没有发生任何帮助将不胜感激
<div class="gwt-PopupPanelGlass" style="position: absolute; left: 0px; top: 0px; visibility: visible; display: block; width: 1680px; height: 222px;"></div>
<div class="gwt-PopupPanel" style="left: 439px; top: 0px; visibility: visible; position: absolute; overflow: visible;">
<div class="popupContent">
<div class="ph-PopupDialog" style="position: relative; width: 800px; height: 220px;">
<div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex;"> </div>
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;">
<div style="position: absolute; z-index: …Run Code Online (Sandbox Code Playgroud) 我试图在我的工作场所用Restassured来展示宁静,并告诉他们与使用jasmine.js相比,它是多么棒和容易使用我怎么会在基本测试中遇到一些问题我试图做我的测试说
Given we have valid credentials for the client using this test
When we try to serach for a medicine '<medicine>'
Then we get a valid '<perfLabel>' response with search results
|medicine|perflabel|
|Salbutamol|perflabel1|
|Panadol|perflabel2|
|Salbutamol (GA)|perflabel3|
Run Code Online (Sandbox Code Playgroud)
当我进入下一步
@When("we try to serach for a medicine '(.*)' ")
public void tryToSearchUsingEquals(String medicine)
{
tsApiActions.requestServiceSearchWhichEquals(medicine);
}
In my Step method
@Step
public void requestServiceSearchWhichEquals(String medicine)
{
host = "http://www.int.abc.com.au/api/cs/v1/terminology-service/trade-product/search-summary?offset=0&limit=20&prefLabel=eq "+medicine+"&sort=prefLabel DESC&cache=false";
requestSend(host);
}
Run Code Online (Sandbox Code Playgroud)
我的问题是
任何帮助非常感谢谢谢
java ×2
selenium ×2
webdriver ×2
iframe ×1
javascript ×1
rest ×1
serenity-bdd ×1
testing ×1
xpath ×1