代码之家  ›  专栏  ›  技术社区  ›  C Alonso C Ortega

同时等待选择器和导航

  •  1
  • C Alonso C Ortega  · 技术社区  · 6 年前

    有可能 wait for a selector 然后继续 navigation 页的 at the same time ?

    下面是一个基本伪代码的例子

    wait for selector (`.modal.error`) //search and wait for this selector until appears caused by an user interaction
    
    browser go to page (`https://my-test-page.com/page1.html`)
    
    browser wait for selector (`#user`) //this selector is found
    
    browser wait for selector (`#password`) //this selector is found
    
    browser wait for selector (`#login`) //this selector is found
    
    //(`.modal.error`) was found because password was entered incorrectly by user-input
    
    //do something because selector (`.modal.error`) was found
    
    browser close();
    

    0 回复  |  直到 6 年前