2016-09-22 59 views
0

我有ff.code,它打開Chrome瀏覽器並按下「F12」打開Chrome開發工具,我一直在谷歌搜索如何按下Ctrl +],但不幸的是沒有找到關於它的任何文章/信息。有沒有人在這裏做這個東西?謝謝!如何在Selenium網絡驅動程序中按Ctrl +]

IWebDriver wdriver = new ChromeDriver(); 

     wdriver.Navigate().GoToUrl("www.samplewebapp.com"); 
     wdriver.Manage().Window.Maximize(); 

     Actions action = new Actions(wdriver); 
     action.SendKeys(OpenQA.Selenium.Keys.F12).Perform(); 
+0

'的SendKeys(OpenQA.Selenium.Keys.Control + 「]」)'? – stuartd

回答

2

選其一

Actions action=new Actions(driver); 
action.SendKeys(OpenQA.Selenium.Keys.Control + "]").Build().Perform(); 

yourWebElement.SendKeys(Keys.Control + "]"); 
+0

有用嗎@Francis Saul? –

相關問題