2016-06-21 5 views
1

에서 오류가 난 코드를 위/아래의 도움으로 크롬 브라우저 빈 창을 실행 할 수 있어요하지만 내가 사용하는 경우 내가셀레늄 크롬 브라우저가 시작지고 있지만 콘솔

[3676:2080:0621/180047:ERROR:cache_util_win.cc(20)] Unable to move the cache: 0 
[3676:2080:0621/180047:ERROR:cache_util.cc(134)] Unable to move cache folder C:\Users\Dhillon's\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache to C:\Users\Dhillon's\AppData\Local\Google\Chrome\User Data\ShaderCache\old_GPUCache_000 
[3676:2080:0621/180047:ERROR:cache_creator.cc(129)] Unable to create cache 
[3676:2080:0621/180047:ERROR:shader_disk_cache.cc(589)] Shader Cache Creation failed: -2 

무엇입니까 일부 오류가있다 driver.get(); 이 라인에서

package LearnStart; 

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.chrome.ChromeDriver; 

public class SeleniumStart { 

    public static void main(String[] args) throws InterruptedException { 
     // TODO Auto-generated method stub 
     System.setProperty("webdriver.chrome.driver", 
       "C:\\Program Files   (x86)\\Google\\Chrome\\Application\\chrome.exe"); 
     WebDriver driver = new ChromeDriver(); 
     // driver.close(); 
     // driver.get("http://www.google.com"); 
    } 

} 
+1

이 게시물을 참조 할 수 있습니다 [http://stackoverflow.com/questions/13724778/how-to-run-selenium-webdriver-test-cases-in-chrome](http://stackoverflow.com)/question/13724778/how-to-run-selenium-webdriver-test-cases-in-chrome) –

답변

0

:

System.setProperty("webdriver.chrome.driver","C:\\Program Files   (x86)\\Google\\Chrome\\Application\\chrome.exe"); 

당신은 크롬 브라우저 바이너리 경로를 설정하는, 당신이 여기에서 설정해야하는 것은 그것 또한 내가 사용하고있는 코드는

를 작동하지 않는 명령 chromedriver 경로.

+0

우리는 설치된 크롬 브라우저를 사용할 수 없다고 말합니다. –

+0

지금은 작동하지만 아직 작동하지 않는 이유는 모르겠습니다. 그 길로 !! 고마워요. –

+3

셀렌은 브라우저와 대화하기 위해 드라이버가 필요합니다. chrome 드라이버는 chromedriver이므로 다운로드해야합니다. 그런 다음 파일 경로에 크롬 드라이버가있는 셀레늄을 알려야합니다. Chromedriver는 자동으로 크롬 설치 위치를 찾고 ** 크롬 설치를 ** 사용합니다. 그러나 운전사는 크롬과 대화 할 수있는 것이지, 브라우저는 할 수 없습니다. – Mobrockers

0

브라우저의 메인 카피가 동작하고있는 중에 새로운 브라우저를 기동하려고하면 실수였습니다. 둘 다 동일한 캐시를 사용하려고합니다. 이를 피하는 방법 - 사용자 데이터를 복사하여 Selenium 코드에 첨부하십시오.

미안 해요, 난 단지 JS 코드를 제공 할 수 있습니다

var webdriver = require('selenium-webdriver'); 
    var chrome = require('selenium-webdriver/chrome'); 
    var o = new chrome.Options(); 
    o.addArguments("user-data-dir=c:/Users/User/AppData/Local/Google/Chrome/User Data/"); 

//(*)string that is above, connects your Chrome profile to Selenium 

    var driver = new webdriver.Builder() 
     .forBrowser('chrome') 
     .setChromeOptions(o).build(); 

복사 사용자 데이터 폴더를, 그리고 셀레늄

에 사본의 경로를 제공
o.addArguments("user-data-dir=c:/Users/User/AppData/Local/Google/Chrome/User Data Copy/"); 

당신이 경로를 따라 사용자 데이터 폴더를 찾을 수 있습니다 :

C :/사용자/사용자 /의 AppData/지역/구글/크롬/사용자 데이터

관련 문제