webdriver

How to handle lazy-loaded images in selenium?

爱⌒轻易说出口 提交于 2021-02-05 10:46:11
问题 Before marking as duplicate, please consider that I have already looked through many related stack overflow posts, as well as websites and articles. I have not found a solution yet. This question is a follow up to this question here Selenium Webdriver not finding XPATH despite seemingly identical strings. I determined the problem did not in fact come from the xpath method by updating the code to work in a more elegant manner: for item in feed: img_div = item.find_element_by_class_name(

java.lang.UnsupportedClassVersionError: org/openqa/selenium/WebDriver : Unsupported major.minor version 52.0 error with Selenium through Java 7

China☆狼群 提交于 2021-02-05 08:28:06
问题 This is the code of selenium code to open the chrome browser and closing it. import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.By; public class TC001_Login_Logout { public static void main(String args[]) throws Exception { System.setProperty("webdriver.chrome.driver", "C:\\Eclipse\\Selenium\\chrome"); WebDriver driver = new ChromeDriver(); driver.get("http://127.0.0.1/orangehrm-2.6/login.php"); System.out.println("Application

Getting error exception in thread “main” java.lang.NullPointerException

回眸只為那壹抹淺笑 提交于 2021-02-05 08:15:48
问题 When i run the following class files in selenium, the browser is launched and URL is opened but error after that: exception in thread "main" java.lang.NullPointerException at guru99project.guru99project.printtitlepage(guru99project.java:25) at guru99project.Main_method.main(Main_method.java:10) Code trials: package guru99project; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa

Getting error exception in thread “main” java.lang.NullPointerException

偶尔善良 提交于 2021-02-05 08:15:46
问题 When i run the following class files in selenium, the browser is launched and URL is opened but error after that: exception in thread "main" java.lang.NullPointerException at guru99project.guru99project.printtitlepage(guru99project.java:25) at guru99project.Main_method.main(Main_method.java:10) Code trials: package guru99project; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa

java.lang.ClassCastException: java.base/java.lang.String cannot be cast to org.openqa.selenium.WebElement when executing test through Selenium

拜拜、爱过 提交于 2021-02-05 08:10:19
问题 I'm trying make an automation test in Selenium WebDriver, but Eclipse is showing me the following error: java.lang.ClassCastException: java.base/java.lang.String cannot be cast to org.openqa.selenium.WebElement Here is my code: public void SeachApp() { Object elem = driver.getPageSource().contains("Staffing"); if (elem != null) { System.out.println("Encontrado"); int width = ((WebElement) elem).getSize().getWidth(); Actions act = new Actions(driver); act.moveToElement((WebElement) elem)

java.lang.ClassCastException: java.base/java.lang.String cannot be cast to org.openqa.selenium.WebElement when executing test through Selenium

只谈情不闲聊 提交于 2021-02-05 08:09:05
问题 I'm trying make an automation test in Selenium WebDriver, but Eclipse is showing me the following error: java.lang.ClassCastException: java.base/java.lang.String cannot be cast to org.openqa.selenium.WebElement Here is my code: public void SeachApp() { Object elem = driver.getPageSource().contains("Staffing"); if (elem != null) { System.out.println("Encontrado"); int width = ((WebElement) elem).getSize().getWidth(); Actions act = new Actions(driver); act.moveToElement((WebElement) elem)

Driver info: driver.version: unknown with ChromeDriver Chrome using Selenium and Python

不羁的心 提交于 2021-02-05 07:37:09
问题 It is showing timed out for driver server to start when I use chrome driver. And when I try to use Firefox it is showing session unexpectedly exited. I am trying to run the Remote driver on a server using selenium in python what should I do? Unable to create new session. UnknownError: Timed out waiting for driver server to start. Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:22:52' System info: host: 'server.*******.com', ip: '61.16.155.6', os.name: 'Linux', os

Selenium C# : Not able to click on an element within #shadow-root (closed) which appears when user mouse over

╄→гoц情女王★ 提交于 2021-02-05 06:57:45
问题 I have attached the screenshot for my code and marked the element that i need to click in red. This element appears after we mouse over on another object - and mouse over is successful and i can see this element get displayed, but failed to click on it My code is var LinksSurce = sourceThumb.FindElement(By.ID("linkSource")); LinksSurce.Click(); Error i am getting is Element not intractable NOTE: i have already read and tried the solutions suggested on these posts but none of them working

How to hide the warning “This type of file can harm your computer” while downloading .xml file using Chrome Chromedriver 79 with Selenium Java

一笑奈何 提交于 2021-02-05 06:38:25
问题 Despite setting safebrowsing.enabled to true / false , the warning ...This type of file can harm your computer... is still being displayed in browser. How to hide this information? 回答1: To enable downloading of file using Chrome/ChromeDriver hiding the warning This type of file can harm your computer you need to: Add the preferences: download.default_directory download.prompt_for_download download.extensions_to_open safebrowsing.enabled As well as add the following arguments to whilelist: -

How to hide the warning “This type of file can harm your computer” while downloading .xml file using Chrome Chromedriver 79 with Selenium Java

拈花ヽ惹草 提交于 2021-02-05 06:38:06
问题 Despite setting safebrowsing.enabled to true / false , the warning ...This type of file can harm your computer... is still being displayed in browser. How to hide this information? 回答1: To enable downloading of file using Chrome/ChromeDriver hiding the warning This type of file can harm your computer you need to: Add the preferences: download.default_directory download.prompt_for_download download.extensions_to_open safebrowsing.enabled As well as add the following arguments to whilelist: -