Issue
I cannot check-in the user credentials encrypt/decrypt logic, to the git, so for now we are copying the class files on CI machines. But it has dependency to contact IT team for copy access. Approach I am thinking is like - create a customer chrome profile, launch it using selenium chrome driver, on Jenkins login page, add user name, password and click remember me. I hope this setting will persisted to next chrome session as well. But, somehow the code is not able check the checkbox. It do identify it but no click.
- I have tried by suing wait, maximize the window, still get the error as :
org.openqa.selenium.ElementClickInterceptedException: element click intercepted: Element is not clickable at point (764, 504). Other element would receive the click: ...
Code I am using :
driver.get(input_params.get("JenkinsURL"));
driver.manage().window().maximize();
WebElement remember_me = driver.findElement(By.xpath("//*[@id='remember_me']"));
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
remember_me.click();
Solution
Please try with the below. It worked for me.
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("URL");
WebElement checkbox = driver.findElement(By.xpath("/html/body/div/div/form/div[4]/label/div[1]"));
checkbox.click();
Answered By - arpita biswas
Answer Checked By - Katrina (JavaFixing Volunteer)