Advanced Techniques

Explore more about browser management by learning tab switching and URL navigation with Selenium.

Scroll focus to control

Due to JavaScript, sometimes certain controls are not visible on the web page, thus making Selenium unable to click on them. If we try to click on such controls, they will throw an error like : “Element is not clickable at point (1180, 43)”. The solution to this problem is scrolling the browser view. We can do this by:

driver.manage().window().setSize(1024, 208); // make browser small
elem = driver.findElement(By.name("
...