Commit bfb5f582 authored by JunHyung An's avatar JunHyung An
Browse files

Add user input chrome and chromedriver location with some arguments

parent 98916628
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -9,22 +9,15 @@ import threading # Import the threading module
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


class MultipleTest(unittest.TestCase):
    def setUp(self):
        options = webdriver.ChromeOptions()
        options.add_experimental_option("excludeSwitches", ["enable-logging"])
        options.add_argument("--ignore-certificate-errors")
        options.add_argument('--start-maximized')
        options.add_argument('--guest')
        options.add_argument("--window-size=1920,1080")

        # Linux Only
        # options.add_argument("--no-sandbox")
        # options.add_argument("--disable-dev-shm-usage")
        # Test case user input
        print("[필수 입력] Chrome 위치 (e.g., /opt/chrome-linux64/chrome, D:\\tmp\\chrome-win64\\chrome.exe): ")
        self.binary_location = input().strip()

        print("[필수 입력] webdriver 위치: ")
        self.webdriver_path = input()
        print("[필수 입력] webdriver 위치 (e.g., /opt/chromedriver-linux64/chromedriver, D:\\tmp\\hromedriver-win64\\chromedriver.exe): ")
        self.webdriver_path = input().strip()

        print("[필수 입력] 테스트 대상 웹 (e.g., https://example.com:8443/): ")
        self.DC_address = input()
@@ -297,13 +290,25 @@ class MultipleTest(unittest.TestCase):
        time.sleep(1)

    def _run_single_driver_actions(self, address, id, pw, account_type, driver_instance_number):

        # Create a new driver instance for this thread
        options = webdriver.ChromeOptions()
        options.add_experimental_option("excludeSwitches", ["enable-logging"])
        options.add_argument("--ignore-certificate-errors")
        options.add_argument('--start-maximized')

        # Secret Mode
        # options.add_argument("--incognito")
        # Guest Mode
        options.add_argument('--guest')
        options.add_argument("--window-size=1920,1080")
        options.add_argument("--headless=new")
        # options.add_argument("--disable-gpu")
        options.binary_location = self.binary_location

        # Linux Only
        # options.add_argument("--no-sandbox")
        # options.add_argument("--disable-dev-shm-usage")

        driver = webdriver.Chrome(executable_path=self.webdriver_path, options=options)
        driver.implicitly_wait(10)  # Common implicit wait for this driver