重试超时:cy.select() 失败,因为此元素:
<select aria-describedby="searchDropdownDescription" class="nav-search-dropdown searchSelect" data-nav-digest="Xa0GQ+pPQ/tdsV+GmRWeXB8PUD0=" data-nav-selected="0" id="searchDropdownBox" name="url" style="display: block;" tabindex="0" title="Search in">...</select>
Run Code Online (Sandbox Code Playgroud)
被另一个元素覆盖:
<input type="text" id="twotabsearchtextbox" value="" name="field-keywords" autocomplete="off" placeholder="" class="nav-input" dir="auto" tabindex="0" aria-label="Search">
Run Code Online (Sandbox Code Playgroud)
修复此问题,或使用 {force: true} 禁用错误检查。我的代码:
describe('Amazon test', function()
{
it('Matching book', function()
{
cy.visit("https://amazon.com")
cy.title().should('eq',"Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more")
cy.get('#twotabsearchtextbox').click({force: true}).get('#searchDropdownBox').select('Books')
})
})
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我有一个 C# 应用程序可以防止屏幕捕获,但我想禁用“黑屏”。
这是我的代码:
[DllImport("user32.dll")]
public static extern uint SetWindowDisplayAffinity(IntPtr hWnd, uint dwAffinity);
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
SetWindowDisplayAffinity(this.Handle, WDA_MONITOR);
}
Run Code Online (Sandbox Code Playgroud)
我可以通过什么方式禁用它?