selenium

Selenium fails with empty exception message

五迷三道 提交于 2021-02-10 07:46:24
问题 I'm using Selenium 2.7.0 and Python 2.6, my OS is Mac OS X 10.7. When I'm trying to instantiate webdriver object I'm getting the following message: selenium.common.exception.WebDriverException: Message: '' Previously I was using Selenium 2.13.0, but I've installed older version because I have working installation on another machine. The first attempt (after reinstallation) to launch webdriver was successful, but all subsequent are not. Then I tried to use Chrome driver instead Firefox, and

Undetected Chromedriver not loading correctly

放肆的年华 提交于 2021-02-10 07:06:49
问题 I'm attempting to use a headless chrome browser with selenium that also bypasses the bot detection test and currently using the the following project https://github.com/ultrafunkamsterdam/undetected-chromedriver Every time I try to implement the code it doesn't recognise the driver. Here is the link for you to understand Here is the code # # UNDETECTED chromedriver (headless,even) # import undetected_chromedriver as uc options = uc.ChromeOptions() options.headless=True options.add_argument('-

How to resolve org.openqa.selenium.NoSuchElementException in Selenium?

十年热恋 提交于 2021-02-10 06:53:55
问题 TestBase Class:- public class TestBase { public static WebDriver driver; public static Properties prop; // TestBase class constructor is used to initialize the properties object to // fetch config variables from config.properties file. public TestBase() { try { File src = new File(".\\src\\main\\java\\com\\config\\config.properties"); FileInputStream fs = new FileInputStream(src); prop = new Properties(); prop.load(fs); } catch (Exception e) { e.printStackTrace(); } } public static void

How to resolve org.openqa.selenium.NoSuchElementException in Selenium?

房东的猫 提交于 2021-02-10 06:53:33
问题 TestBase Class:- public class TestBase { public static WebDriver driver; public static Properties prop; // TestBase class constructor is used to initialize the properties object to // fetch config variables from config.properties file. public TestBase() { try { File src = new File(".\\src\\main\\java\\com\\config\\config.properties"); FileInputStream fs = new FileInputStream(src); prop = new Properties(); prop.load(fs); } catch (Exception e) { e.printStackTrace(); } } public static void

Why is throw new SkipException() skipping all my methods?

我的未来我决定 提交于 2021-02-10 06:53:29
问题 Why is throw new SkipException() skipping all my methods across all classes? Class one has a method which fails therefore the remaining methods in that class are skipped and the skipcounter is set to 0. Class two should execute all methods and all methods should pass in class two because the skip counter was set to 0 and after class one was executed. The following code seems to skip all methods even though there is only one assert.fail which is contained in class one? Test Base: import org

jenkins selenium do not run test headlessly

╄→гoц情女王★ 提交于 2021-02-10 06:45:47
问题 I am running pytests selenium tests using jenkins. I ran test on my local machine it works. But when I run through jenkins, it runs on remote jenkins machine(creates workspace on remote jenkins machine) headlessly and it fails with test errors such as 'element not visible' or 'timeout exception due to element not clickable'. After this I ran test on remote machine directly (windows server) in workspace. It launches chrome browser and runs test and passes. Why is it running test headlessly

How to scroll within a table using watir-scroll

牧云@^-^@ 提交于 2021-02-10 06:41:08
问题 I have an application in which there is a dynamic table, rows are loaded only when you scroll up or down. Watir-scroll is scrolling the entire page. Is there anyway I can perform the scrolling within that table? 回答1: Making an element scrollable is often done by setting the overflow style. It is likely on a div that contains the table . For example: <html> <body> <div style="overflow:scroll; height:250px;"> <table> <tr height="200px"><td>Cell A</td></tr> <tr height="200px"><td>Cell B</td></tr

How to prevent (python) Selenium webdriver from triggering “Microsoft Malicious Software Removal Tool” to ask if it may reset browser settings?

爱⌒轻易说出口 提交于 2021-02-10 06:39:08
问题 Recently Selenium chrome webdriver started to run into problems by triggering Microsoft Malicious Software Removal Tool to request if it may reset browser settings. How to get around this? Is there an argument to add to options like --disable-extensions solved a popup problem before? from selenium import webdriver options = webdriver.chrome.options.Options() options.add_argument("--disable-extensions") driver = webdriver.Chrome(chrome_options=options) A temporary solution may be driver.find

Python Selenium Printing Save-As-PDF Waiting for Filename Input

℡╲_俬逩灬. 提交于 2021-02-10 06:32:11
问题 I'm trying to save a website as PDF through printing dialog. My code allows me to save as pdf, but asks me to input a filename, which I don't know how to pass a filename to the pop up box. Attached is my code: import time from selenium import webdriver import os class printing_browser(object): def __init__(self): self.profile = webdriver.FirefoxProfile() self.profile.set_preference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", False) self.profile.set_preference("pdfjs

Python Selenium Printing Save-As-PDF Waiting for Filename Input

元气小坏坏 提交于 2021-02-10 06:32:08
问题 I'm trying to save a website as PDF through printing dialog. My code allows me to save as pdf, but asks me to input a filename, which I don't know how to pass a filename to the pop up box. Attached is my code: import time from selenium import webdriver import os class printing_browser(object): def __init__(self): self.profile = webdriver.FirefoxProfile() self.profile.set_preference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", False) self.profile.set_preference("pdfjs