javascript
  • iframe
  • webdriver
  • protractor
  • 2017-03-07 35 views 0 likes 
    0

    我想盡量減少iframe的形式,併發布我想開始在我的正常頁面上工作。但是,當我嘗試切換到默認內容瀏覽器重定向到原始頁面,如:數據。量角器從iframe切換到默認內容

    browser.switchTo().frame(iframeLiveChat).then(function(){ console.log("i have entered frame"); driver.findElement(by.xpath(".//*[@id='title']")).click().then(function(){ console.log("i have clicked button"); browser.switchTo().defaultContent(); //After this line the browser redirects itself to :data page instead of the url it has in it. }); }); 無法切換回默認內容。

    回答

    0

    您是否嘗試過不讓您的開關回撥?

    browser.switchTo().frame(iframeLiveChat).then(()=> console.log("i have entered frame")) 
    element(by.xpath(".//*[@id='title']")).click().then(()=> console.log("i have clicked button")) 
    browser.switchTo().defaultContent(); 
    
    相關問題