webdriverwait

Is there a change in the handling of unhandled alert in ChromeDriver and Chrome with Selenium?

坚强是说给别人听的谎言 提交于 2019-12-18 09:25:46
问题 I have a test that has been running fine for months. One thing it does is cause an alert and then verify the alert text. This is running with Selenium, Java and Chrome Driver 76.0.3809.68. Lately it has been giving me the error: "No such alert". What happens is it clicks a button and waits for an alert if there: try { button.click(); } catch (UnhandledAlertException ex) { // nothing } // then here goes code to accept the alert and get the text when stepping through I see the alert. When I run

'ElementNotVisibleException:element not interactable' error locating Google Search button even though element was waited for on Google Home Page

淺唱寂寞╮ 提交于 2019-12-17 21:35:32
问题 So I have a Selenium test that waits for a button to load up before it interacts with it. As seen in my code, I have implemented it so that the driver will wait 14 seconds (14 is just a random number), or it will move on if the element is located before 14 seconds. However, even after I have waited for element to load, and I try to interact with it (using Click() method), I get this error showing that the element is not 'interactable'. The funny thing is, this actually works some times- where

How to automate Google Home Page auto suggestion?

五迷三道 提交于 2019-12-17 21:34:11
问题 This is my test class with all the lines of code. I think the issue is in the xpath because of that it is not able to find the elements. package practice; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class selPractice { public static void main(String[] args) throws InterruptedException { String key="webdriver.chrome

Skip waiting for a website timer selenium Python

允我心安 提交于 2019-12-17 21:18:23
问题 I'm running Selenium in Python ide with geckodriver. The site I'm trying to open has a timer of 30 seconds that after this 30 seconds a button appears and I send a click on it. What I'm asking is the following: Can I somehow ignore/skip/speed up the waiting time? Right now what I'm doing is the following: driver = webdriver.Firefox() driver.get("SITE_URL") sleep(30) driver.find_element_by_id("proceed").click() Which is very inefficient because every time I run the code to do some tests I need

Find the reCAPTCHA element and click on it — Python + Selenium

荒凉一梦 提交于 2019-12-17 17:18:05
问题 I need some help. There is URL: https://www.inipec.gov.it/cerca-pec/-/pecs/companies. I need to click checkbox Captcha: My code is look like: import os, urllib.request, requests, datetime, time, random, ssl, json, codecs, csv, urllib from urllib.request import Request, urlopen from urllib.request import urlretrieve from datetime import datetime from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from

how to handle mutliple windows in selenium webdriver ,need to switch from second to third window

允我心安 提交于 2019-12-17 10:03:14
问题 I am trying to switch from second window to third window .But not able to handle third window.could someone please help me to resolve this issue. I have used logic of compare the title of window but its not working. code======================= package Package_1; import static org.testng.Assert.assertEquals; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org

How to add explicit wait in PageFactory in PageObjectModel?

橙三吉。 提交于 2019-12-17 07:54:21
问题 I have added hardcode wait thread.sleep() in my below code. How to use explicit wait. I want to wait till "username" WebElement appear. My program is working perfectly. I have already written testcases. package com.pol.zoho.PageObjects; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.WebDriverWait; public class ZohoLoginPage { WebDriver

'UnexpectedTagNameException' and Element should have been “select” but was “div” error using 'Select' function through Selenium java

谁都会走 提交于 2019-12-17 07:50:52
问题 In this form selection of drop down is not working. In above image I want to select 'Borrowing Capacity' and I write code for it public static void main(String[] args) throws InterruptedException { WebDriver driver =new ChromeDriver(); //driver.manage().window().maximize(); driver.get("http://www.ia.ca/"); Thread.sleep(3000); driver.findElement(By.xpath("//*[@id=\"nav-secondaire\"]/div[1]/ul/li[4]/a")).click(); driver.findElement(By.xpath("//*[@id=\"nav-secondaire\"]/div[1]/ul/li[4]/ul/li[1]

Unable to select depart date in https://spicejet.com through Selenium and Java

穿精又带淫゛_ 提交于 2019-12-17 05:14:23
问题 I am trying to select a "Depart date" as of 31st october 2018 from the calender https://spicejet.com/ But I am getting error "unknown error: Element is not clickable at point (832, 242). Other element would receive the click: ..." Please help me out. Here is my code getting such exception: public class bookflight extends Thread { UtilityMethods utilObj= new UtilityMethods(); @Test public void SighnUp() throws IOException { utilObj.getdriver().get("https://spicejet.com"); utilObj.getdriver()

Selenium python Error: element could not be scrolled into view

心已入冬 提交于 2019-12-17 05:14:07
问题 I am working on automating the IdentiGO application for my company, and I'm getting the following error: Internal Server Error: /identigo Traceback (most recent call last): File "/Users/jane/Code/maynard_env/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/Users/jane/Code/maynard_env/env/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by