์๋ํ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํด ๋ณธ ์ฌ๋์ ์๊ฒ ์ง๋ง, ํ ๋ฒ ํ ์คํธ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๋ฉด ์ค์ ์น ๋๋ผ์ด๋ฒ๊ฐ ์คํ๋๋ฉด์ ํ ์คํธ๋ฅผ ์คํํ๋ค. ํ์ง๋ง, ๋งค๋ฒ ์ด ํ ์คํธ๋ฅผ ์ง์ ํ์ธํด์ผ ํ๋ ๊ฒ์ ์๋๋ค. ์ด ์นํ์ด์ง๋ฅผ ๋์ฐ์ง ์๊ณ ํ ์คํธ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํด ๋ณผ ์๋ ์๋ค. ๊ทธ๋ ํค๋๋ฆฌ์ค ๋ชจ๋๋ฅผ ์ฌ์ฉํ ์ ์๋ค.
ํค๋๋ฆฌ์ค ๋ชจ๋
์น๋๋ผ์ด๋ฒ ์๋ํ ํ ์คํธ๋ฅผ ์คํํ๋ ๋ฐ ์๋นํ ์ ์ฉํ๋ค. ์ ์์ ์ผ๋ก ์คํ๋๋ฉด์๋ UI๊ฐ ๋ณด์ด์ง ์์ ๋น ๋ฅด๊ณ ํจ๊ณผ์ ์ผ๋ก ํ ์คํธ๋ฅผ ์คํํ๋ค. CI(์ง์์ ํตํฉ)ํ๊ฒฝ์์ ์ ์ฉํ๋ค.
๋์ค์ ํ ์คํธ ์๋ ๋ฐฐํฌ๋ฅผ ์ ์ฉํ ๋๋ ํค๋๋ฆฌ์ค ๋ชจ๋๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ๋น ๋ฅผ ๊ฒ์ด๋ค.
Chrome ์์ ํค๋๋ฆฌ์ค ๋ชจ๋ ์ฌ์ฉ
ChromeOptions ํด๋์ค์ ์ธ์คํด์ค๋ฅผ ๋ง๋ค์ด์ setHeadless() ๋ฉ์๋๋ฅผ true๋ก ์ค์ ํ๋ฉด ํค๋๋ฆฌ์ค๋ชจ๋๋ก ์คํํ ์ ์๋ค.
@BeforeMethod
public void beforeMethod() {
System.setProperty("webdriver.chrome.driver", "./src/test/resource/drivers/chromedriver");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setHeadless(true);
driver = new ChromeDriver(chromeOptions);
driver.get("http://www.naver.com/");
}