Button inside of anchor link works in Firefox but not in Internet Explorer?

You can’t have a <button> inside an <a> element. As W3’s content model description for the <a> element states: “there must be no interactive content descendant.” (a <button> is considered interactive content) To get the effect you’re looking for, you can ditch the <a> tags and add a simple event handler to each button which … Read more

Gmail login using selenium webdriver in java

Here is the working code block to login into your Gmail account through a valid set of credentials- System.setProperty(“webdriver.gecko.driver”,”C:\\your_directory\\geckodriver.exe”); WebDriver driver = new FirefoxDriver(); driver.manage().window().maximize(); String url = “https://accounts.google.com/signin”; driver.get(url); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); WebElement email_phone = driver.findElement(By.xpath(“//input[@id=’identifierId’]”)); email_phone.sendKeys(“your_email_phone”); driver.findElement(By.id(“identifierNext”)).click(); WebElement password = driver.findElement(By.xpath(“//input[@name=”password”]”)); WebDriverWait wait = new WebDriverWait(driver, 20); wait.until(ExpectedConditions.elementToBeClickable(password)); password.sendKeys(“your_password”); driver.findElement(By.id(“passwordNext”)).click(); Update(5-Jan-2020) Optimizing the above … Read more

JavaScript Time Zone is wrong for past Daylight Saving Time transition rules

It’s actually specified behavior to use the current DST rules, and to ignore the ones in place at the particular date/time being examined. See ES5 15.9.1.8: “The implementation of ECMAScript should not try to determine whether the exact time was subject to daylight saving time, but just whether daylight saving time would have been in … Read more

How to getting browser current locale preference using javascript?

The following properties exist on the navigator object (which can also be known as clientInformation on IE but there’s no reason ever to use that name): language (non-IE, browser install language) browserLanguage (IE, browser install language) userLanguage (IE, user-level OS-wide language setting) systemLanguage (IE, OS installation language) But! You should never use any of these … Read more

Reached error page: about:neterror when trying to navigate to other tabs if there is a form submit under that tab

This error message… org.openqa.selenium.WebDriverException: Reached error page: about:neterror?e=connectionFailure&u=https%3A//192.168.1.20/network.cgi&c=UTF-8&f=regular&d=Firefox%20%E6%97%A0%E6%B3%95%E5%BB%BA%E7%AB%8B%E5%88%B0%20192.168.1.20%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E8%BF%9E%E6%8E%A5%E3%80%82 …implies that there was a Network Error while initializing a WebDriver / Web Browsing session. However, the main issue is, in case of these Network Errors for a valid and absolute URL it is expected for the WebDriver instance i.e. the driver to return a value of … Read more

Selenium: FirefoxProfile exception Can’t load the profile

Update: Selenium team fixed in latest version. For almost all environments the fix is: pip install -U selenium Unclear at which version it was fixed (apparently r13122), but certainly by 2.26.0 (current at time of update) it is fixed. This error means that _wait_until_connectable is timing out, because for some reason, the code cannot connect … Read more