selenium-webdriver

How to explicitly wait while using page factory in Selenium?

橙三吉。 提交于 2020-07-20 17:06:58
问题 I'm going to organize an explicit wait in Selenium like this: WebDriverWait = new WebDriverWait(driver,30); WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(locator)); The problem is that I don't have the driver in my class, because I used the PageFactory, not a constructor in a test class: MyClass myform = PageFactory.InitElements(driver, MyClass.class) What is a good decision to organize explicit wait in this case? 回答1: I would suggest that you use the PageFactory

Browsermob proxy with selenium generates empty output

不打扰是莪最后的温柔 提交于 2020-07-19 04:33:45
问题 I am using selenium 3.0.2 and browsermob proxy 0.7.1 to capture the network data. All I am getting is an empty JSON. My code is: server = Server("/Users/dev/Downloads/browsermob-proxy-2.1.2/bin/browsermob-proxy") server.start() proxy = server.create_proxy() if browser is None: profile = webdriver.FirefoxProfile() profile.set_preference("browser.privatebrowsing.autostart", True) browser = webdriver.Firefox(firefox_profile=profile, proxy=proxy.selenium_proxy()) proxy.new_har("google", options={

How to take a screenshot of a full browser page and its elements using selenium-webdriver/capybara in Ruby?

强颜欢笑 提交于 2020-07-18 10:43:06
问题 I am working on screenshot automation. In particular, I am trying to achieve the following: Prompt the user for the links to different pages on the website X Prompt the user for the class name Y I should be able to visit a website X login page, provide login details (assume they are known), click on "submit" button, that should redirect me to the "home" page Then I look at the list of links, provided by the user, visit each page and take screenshots of all elements, that have class Y (or the

Junit 5 - No ParameterResolver registered for parameter

。_饼干妹妹 提交于 2020-07-18 03:26:43
问题 Source : JUnit 5, Eclipse 4.8 , Selenium I can write up and execute Selenium script without any special test framework but I wanted to use Junit 5 (because we have dependency with other tools) and I have never seen such error "org.junit.jupiter.api.extension.ParameterResolutionException" while working with Junit 4. Currently it's Junit 5 and I googled it to get some sort of idea but can not resolve the issue. Test Script : package login; import static org.junit.jupiter.api.Assertions

How to assign a specific string value in search box to get this hit entered blindly for creating a report using python and selenium?

被刻印的时光 ゝ 提交于 2020-07-16 06:18:31
问题 I am struggling with assigning a fix string value to be selected in a inspected search box using python but it's all in vein. Please have a look in below image - here I want to choose the value automatically and get the create button clicked automatically: from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium import webdriver from selenium.webdriver.common.by import By #All the inspected fields EMAILFIELD = (By

How to assign a specific string value in search box to get this hit entered blindly for creating a report using python and selenium?

痞子三分冷 提交于 2020-07-16 06:18:12
问题 I am struggling with assigning a fix string value to be selected in a inspected search box using python but it's all in vein. Please have a look in below image - here I want to choose the value automatically and get the create button clicked automatically: from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium import webdriver from selenium.webdriver.common.by import By #All the inspected fields EMAILFIELD = (By

SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python

拜拜、爱过 提交于 2020-07-12 05:11:08
问题 I am using python 3 on windows 7, selenium, chromedriver version 84 (latest) to automate my chrome browser. I am using this script: from selenium import webdriver #import chromedriver_binary # Adds chromedriver binary to path driver = webdriver.Chrome() driver.get("http://www.python.org") and I always get this error upon running it. Traceback (most recent call last): File "D:\Huzefa\Desktop\zzzzzz.py", line 4, in <module> driver = webdriver.Chrome() File "C:\Users\Huzefa\AppData\Local

Why doesn't ChromeDriver require Chrome or Chromium?

我怕爱的太早我们不能终老 提交于 2020-07-11 10:16:47
问题 ChromeDriver is working on my system even though I don't have Chrome or Chromium installed. Based on the name, I thought it was like a "car driver" where you still need a car to get going. Or maybe like a product's API where you still need the product for your API calls to accomplish something. Edit: Whoops, Chromium is installed after all. 回答1: Of course ChromeDriver requires Chrome or Chromium . As per ChromeDriver - WebDriver for Chrome ChromeDriver is a separate executable that WebDriver

How do i change the download path dynamically during runtime using chrome in Selenium

◇◆丶佛笑我妖孽 提交于 2020-07-10 10:26:29
问题 I have 20 pages and each page have 2 testcases and each testcase download a number of files. I want to change the download directory for each test case at runtime. Here is the 'TestBaseClass' code which downloading all the files in one particular folder from where I have to separate them as per category and place them into a particular folder. There are 20 folders and each folder is having 2 subfolders 'ChapterLevel' & 'PracticeLevel' in which I do have to place it manually. Is it possible to

None response and empty title from selenium webdriver in functional test

非 Y 不嫁゛ 提交于 2020-07-10 10:26:28
问题 I followed this tutorial (Build DevOps CI/CD pipeline for Python Flask with Azure DevOps). There is a command line task to execute a functional test which I get an error while running it. The command line task script is as follows: pip install selenium && pip install pytest && pytest Tests/functional_tests/ --webAppUrl=$(webAppUrl.AppServiceApplicationUrl) --junitxml=TestResults/test-results.xml This is the script used for functional test: import pytest from selenium import webdriver import