selenium-chromedriver

How to select a dynamic value in select2 dropdown for selenium

耗尽温柔 提交于 2019-12-25 01:33:15
问题 I am writing a test where data needs to be selected from a select2 drop down. Ajax call is fetching the data which can change according to scenario. My solution works if i enter a hard coded value but that solution is not feasible for me driver.findElement(By.id("select2-company-container")).click(); WebElement dropdown=driver.findElement(By.xpath("//ul[@id='select2-company-results']")); driver.findElement(By.className("select2-search__field")).sendKeys("Einstein"+ Keys.ENTER); I have tried

Schedule Python Selenium to run daily using Batch .bat

萝らか妹 提交于 2019-12-25 01:22:25
问题 I create a batch file to run Python Selenium, but the browser does not open, but with an error msg os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home my .bat script: "C:\Users\tom\AppData\Local\Programs\Python\Python37-32\python.exe" "C:\Users\tom\Downloads\selenium.py" pause my python code in Jupyter notebook is:

Why can't selenium find the chrome driver?

余生长醉 提交于 2019-12-25 00:53:08
问题 I am following a tutorial on using selenium and python to make a web scrapper for twitter, and I ran into this error. File "C:\Python34\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__ self.service.start() File "C:\Python34\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please

Remote File Downloads

一个人想着一个人 提交于 2019-12-25 00:38:07
问题 Background : Working on some file download tests with Protractor and Chrome. I run on a selenium grid, so the tests and my Node env are executing on a server (e.g. 8.2.2.2 ) while the file downloads are on a remote windows machine (e.g. 14.3.3.3 ). The file download used to be stored on the same server that also kicked off the tests, so I was just waiting for a file to exist before performing my assertion: browser.wait(() => { return fs.existsSync(filePath) }).then(() => { // expect something

Serenity BDD dont delete Browser Memory

时间秒杀一切 提交于 2019-12-24 21:17:36
问题 @Managed(uniqueSession = true, clearCookies = Never) I have a serenity app that has a Oauth login mechanism using the Microsoft login. I am using the above code to make browser retain browser's memory. What I want to happened is I have a test to Login using the Microsoft Oauth. Then Have another test that will open the dashboard. Since the previous test already log in. I am hoping that Opening the dashboard of the app should be pass. Unfortunately when I access the dashboard. The test will

Selenium / Watir TCP connection fails only on worker dyno heroku

前提是你 提交于 2019-12-24 20:54:46
问题 Why would watir only fail on a heroku worker node? I'm trying to go to run a basic function of going to google.com. This works fine when I run it on a web dyno but fails when I use delayed job to run it on a worker. The code is as follows Selenium::WebDriver::Chrome.path = "/app/.apt/usr/bin/google-chrome" Selenium::WebDriver::Chrome.driver_path = "/app/vendor/bundle/bin/chromedriver" browser = Watir::Browser.new :chrome browser.goto "google.com" I then receive the following error: Failed to

GOCD pipeline, Selenium ChromeDriver window size is not set

时光毁灭记忆、已成空白 提交于 2019-12-24 20:52:43
问题 When setting the window size for chrome to either maximized or 1980x1080 using ChromeOptions.addArguments("--start-maximized"); or driver.manage().window().setSize(new Dimension(1980,1080)); or ChromeOptions.addArguments("window-size=1980,1080"); or ChromeOptions.addArguments("--window-size=1980,1080"); the Chrome window is set to the correct size and works perfectly when running the tests from either the terminal or running individual test cases from intellij (all tests Pass) However, when

In selenium, when I search Xpath how do I capture the element two positions before?

空扰寡人 提交于 2019-12-24 18:18:07
问题 In Python 3 and selenium I have this script to automate the search of terms in a site with public information from selenium import webdriver # Driver Path CHROME = '/usr/bin/google-chrome' CHROMEDRIVER = '/home/abraji/Documentos/Code/chromedriver_linux64/chromedriver' # Chosen browser options chrome_options = webdriver.chrome.options.Options() chrome_options.add_argument('--window-size=1920,1080') chrome_options.binary_location = CHROME # Website accessed link = 'https://pjd.tjgo.jus.br

Getting Difference in count of “Total Number of links” on webpage through Selenium and Browser Development Tools

我怕爱的太早我们不能终老 提交于 2019-12-24 17:53:22
问题 I have written code to count total number of link on Web Page. I used JavascriptExecutor in selenium of that. But issue is that I am getting different count for total number link Java Script command in Selenium and same in browser console. Here are testing details: Website under test : https://www.ebay.com/ Test: Total number of links on Home Page of Ebay. Selenium code and result: WebDriver driver = new ChromeDriver(); driver.get("https://www.ebay.com/"); driver.manage().timeouts()

How to grab the <h2> text from <div> using VBA Selenium on Chrome and Insert Date to SpreadSheet?

こ雲淡風輕ζ 提交于 2019-12-24 15:59:55
问题 I have been learning VBA for a project and I am having trouble grabbing certain elements out of the html and have them populate on an excel spreadsheet. The code I have used has returned no errors and from what I can see it should be working. Here is my VBA Code: Option Explicit Public Sub GrabShipping() Dim t As Date Dim ele As Object Dim driver As New ChromeDriver Dim post As WebElement Dim i As Integer Dim mysheet As Worksheet Const MAX_WAIT_SEC As Long = 10 Const INURL = "https://ss3