ChromeDriver และเบราว์เซอร์ Chrome ไม่ตรงกัน

ล่าสุด Chrome ได้รับการอัปเดตเป็นเวอร์ชัน 79 ฉันได้อัปเดต Chromedriver เป็นเวอร์ชันที่เกี่ยวข้องเช่นเดียวกับที่ฉันเคยทำ - ภายในโปรเจ็กต์ Java ของฉัน แต่เมื่อฉันปรับใช้ Zalenium ในคอนเทนเนอร์ภายในบ้าน/seluser/ ก็ยังคงมี Chromedriver-78 ฉันได้ลองลบ Chromedriver เก่านั้นด้วย 'kubectl rm chromedriver' - ไฟล์กำลังถูกลบ แต่ฉันไม่สามารถทำการทดสอบใด ๆ ได้ ฉันได้ลองปรับใช้ Zalenium อีกครั้ง แต่ก็ไม่มีโชค ทุกอย่างมีการประทับเวลาด้วยวันที่ล่าสุด ยกเว้นไฟล์ Chromedriver ไม่เคยมีปัญหานี้มาก่อนแน่นอน ฉันจะอัปเดต Chromedriver เพื่อให้อัปเดตในคอนเทนเนอร์ทั้งหมดได้อย่างไร Zalenium ควบคุม/จัดการการอัปเดตเบราว์เซอร์ Chrome อย่างไร

นี่คือ Chromedriver ที่ติดตั้งคอนเทนเนอร์ทุกครั้งที่ฉันใช้ 'โต้ตอบผ่าน VNC': home/seluser

นี่คือข้อมูลโค้ดพร้อมวิธีจัดการการเข้าถึง Chromedriver:

public static MutableCapabilities getChromeCapability() {
    String chromePath = prop_conf_browsers.getProperty("chromePath");
    String chromeDriverPath = prop_conf_browsers.getProperty("chromeDriverPath");
    System.out.println(chromeDriverPath);
    String chromeProfileDir = prop_conf_browsers.getProperty("chromeProfileDir");
    if (chromePath != null && !chromePath.equalsIgnoreCase("default") && !chromePath.equalsIgnoreCase("")) {
        System.setProperty("webdriver.chrome.bin", chromePath);
    }
    if (chromeDriverPath != null && !chromeDriverPath.equalsIgnoreCase("default")
            && !chromeDriverPath.equalsIgnoreCase("")) {
        System.setProperty("webdriver.chrome.driver", chromeDriverPath);
    }

ข้อมูลสิ่งแวดล้อม:

capabilities: Capabilities {acceptSslCerts: true, browserName: chrome, maxInstances: 1, platform: LINUX, platformName: LINUX, resolution: 1920x1080, screen-resolution: 1920x1080, screenResolution: 1920x1080, seleniumProtocol: WebDriver, server:CONFIG_UUID: 456a4fcc-xxxx-xxxx-xxxx-xxx..., tz: America/Chicago, version: 79.0.3945.79}

person Yauhen    schedule 14.12.2019    source แหล่งที่มา


คำตอบ (1)


คุณไม่จำเป็นต้องกำหนดค่า ChromeDriver ในโปรเจ็กต์ Java ของคุณ เนื่องจากคอนเทนเนอร์นักเทียบท่าได้กำหนดค่าทั้งหมดนี้แล้ว

person diemol    schedule 15.12.2019
comment
ขอบคุณสำหรับการชี้แจงว่า หากคอนเทนเนอร์นักเทียบท่ากำหนดค่าไว้แล้วก็ยิ่งดียิ่งขึ้น! คำถามยังคงอยู่ ฉันจะซิงค์เบราว์เซอร์ Chrome และ Chromedriver ได้อย่างไร ฉันต้องทำอะไรบางอย่างในส่วนของฉันหรือไม่? - person Yauhen; 15.12.2019
comment
Chromedriver และ ChromeBrowser ไม่ซิงค์กัน ปัญหาได้รับการแก้ไขแล้วในการคอมมิตนี้: github.com/elgalu/docker-selenium/commit/ - person Yauhen; 16.12.2019