selenium-chromedriver

How to press “ALT+T” in Selenium webdriver with java. I want to switch tabs by pressing it

China☆狼群 提交于 2020-01-15 07:11:32
问题 I have used below code, but it throws an error saying "Cannot focus on element". Please help. String selectAll = Keys.chord(Keys.ALT,"T"); driver.findElement(By.tagName("html")).sendKeys(selectAll); 回答1: The best way to switch tabs would be to use switchTo(), if you know the new window name: driver.switchTo().window(WINDOW_NAME); Otherwise get a list of the open windows and switch using that: List<String> openTabs = driver.getWindowHandles(); for(String tab in openTabs) { driver.switchTo()

element not visible despite availability in document in python selenium

谁说胖子不能爱 提交于 2020-01-15 05:23:34
问题 Page Link : https://contacts.google.com/u/1/?pageId=none Desired: I want to select all contacts by clicking the highlighted SVG caret icon in attached image. Problem facing : Getting error element not visible on svgicon.click() . Though element is clearly available in visible DOM as per image attached. Observation : I have noticed that if we manually click on caret icon then DropDown html code is being inserted via JavaScript & on any other body click it is removing the DropDown html code. I

element not visible despite availability in document in python selenium

和自甴很熟 提交于 2020-01-15 05:23:26
问题 Page Link : https://contacts.google.com/u/1/?pageId=none Desired: I want to select all contacts by clicking the highlighted SVG caret icon in attached image. Problem facing : Getting error element not visible on svgicon.click() . Though element is clearly available in visible DOM as per image attached. Observation : I have noticed that if we manually click on caret icon then DropDown html code is being inserted via JavaScript & on any other body click it is removing the DropDown html code. I

Unable to sign into google with selenium automation because of “This browser or app may not be secure.”

≡放荡痞女 提交于 2020-01-15 03:23:06
问题 I am trying to login to google with selenium and I keep getting the error that "This browser or app may not be secure." The function I use to log in is: async function loginToChrome(driver, username, password) { await driver.get("https://accounts.google.com/signin"); await driver.sleep(1000); let email_phone = await driver.findElement( By.xpath("//input[@id='identifierId']") ); await email_phone.sendKeys(username); await driver.findElement(By.id("identifierNext")).click(); await driver.sleep

Timed out receiving message from renderer

久未见 提交于 2020-01-14 10:42:42
问题 I am trying to get status of transactions from some web portal and I am using below chrome settings in my java application and I am getting Timed out receiving message from renderer: 60.000 and all the pending transactions are timing out. Session info: headless chrome=68.0.3440.75 Driver info: chromedriver=2.38 (0) platform=Linux 2.6.32-696.23.1.el6.x86_64 x86_64) How i can handle this and if any timeout is happening then move to next transaction? I have tried all permutation and combinations

Web scrapping with a double loop with selenium and using By.SELECTOR

帅比萌擦擦* 提交于 2020-01-14 03:04:11
问题 I am trying to get the pdf files from this website. I am trying to create a double loop so I can scroll over the years (Season) to get all the main pdf located in each year. The line of code is not working is this one. The problem is, I can not make this line work (The one that is supposed to loop all over the years (Season) : for year in wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, "#season a aria-valuetext"))): year.click() This is the full code: os.chdir("C:..") driver

How to update Chromedriver on Ubuntu?

老子叫甜甜 提交于 2020-01-13 19:59:27
问题 I want to update Chromedriver to the latest version. How can I do this on the command line? 回答1: Download chromedriver from https://chromedriver.storage.googleapis.com/2.38/chromedriver_linux64.zip Unzip it and put it in location /usr/bin/chromedriver and change its permission to 755 using chmod. 回答2: This will download the latest version, and install it to the correct location, with the correct permissions. version=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE) wget

Selenium doesn't refresh page on Jenkins

妖精的绣舞 提交于 2020-01-13 14:54:09
问题 I have a test case that goes something like this: open homepage if there is no content present refresh page continue with other steps... This is the relevant part of the code: public JpoPO() { driver.get(Settings.JPO_TEST_URL); PageFactory.initElements(driver, this); System.out.println("[INFO] Homepage initialized."); zatvoriModal(); refreshIfNeeded(); zatvoriModal(); (new WebDriverWait(driver, 30)).until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("#loading"))); System.out

Is it possible to disable file download in chrome using selenium

只谈情不闲聊 提交于 2020-01-13 10:40:19
问题 On visiting some pages using ChromeDriver and Selenium, downloading of a particular file is happening automatically. Because of the file download, the code is not proceeding further. Is it possible to disable downloading of file using any ChromeOptions or preferences that can be set while creating ChromeDriver. Tried the following ChromeOptions, but none helped. prefs.put("download.default_directory", "NUL"); prefs.put("download.prompt_for_download", false); prefs.put("profile.default_content

Is it possible to build a web automation that can run through a browser?

不想你离开。 提交于 2020-01-13 05:46:11
问题 I have created a Java program that utilizes Chrome Driver, Selenium, and Java Excel API. The program is used to automate a few different processes on Google Chrome. Currently, setting up this automation is more complicated than I would like it to be: the user needs to download a zipped folder, unzip it, download the Java Runtime Environment, and launch the program using the executable. My goal is to simplify the installation of the automation. Ideally, a user would come to a SharePoint