selenium

How to configure rules for wcag2aa in axe-core for selenium java

两盒软妹~` 提交于 2021-01-29 07:18:08
问题 I want to add rules in axe in selenium for wcag2aa. Can anyone help me with the syntax? JSONObject responseJSON = new AXE.Builder(getBrowser() .getWebDriver(), scriptUrl).options( ("{ rules: { 'wcag2aa' } }")).analyze(); I have tried the above code but it is giving me exception Thanks. 回答1: wcag2aa is a list of rules and not a rule itself. Try: .options("{ runOnly: ['wcag2aa'] }") Or you can only run multiple lists of rules like so: .options("{ runOnly: ['wcag2a', 'wcag2aa', 'best-practice']

Using scrollbar by editing attribute using Selenium Python

笑着哭i 提交于 2021-01-29 07:06:13
问题 This is an addition to the first version of the question i asked since i still can not solve it so more details are in here Selenium scroll into view with a twist Python I have managed to collect the attribute ..but have no idea how to edit it to work in the way i want..i want to be able to just simply scroll down i have tried multiple different ways to acheive this but none of them seem to work Here is the code of the countless ways i have tried to figure this out. scrollbar = str(driver1

wait until angular 2+ has finished loading issue

三世轮回 提交于 2021-01-29 06:43:56
问题 I recently posted a question about an issue I have white testing an angular based application (ref: wait until Angular has finished loading issue ) Turns out that the check done was valid for angular 1.x apps, while our application runs on angular 6.x. I've then found out that post: Detecting that Angular 2 is done running which explains how to do a similar check but for angular 2+ apps. I've set up the check in a similar fashion to "Michal Filip" explained. I've also tried to use the

Scroll element in selenium VBA

二次信任 提交于 2021-01-29 06:41:48
问题 I am trying to focus on an element to make this element in the center of the screen or way from the top to be above the middle. This is what I did .FindElementById("toBePaid[" & r - 1 & "]").ExecuteScript "this.scrollIntoView(true); window.scrollBy(0, -(window.innerHeight - this.clientHeight)-150);" But I couldn't see the element as it is at the top-most of the screen of the website. I have tried too .FindElementById("toBePaid[" & r - 1 & "]").ScrollIntoView True But the same problem is still

Python and selenium: how to change Firefox's profile multiple times

百般思念 提交于 2021-01-29 06:31:53
问题 I set up Firefox's profile and launched the driver with that profile, after that, I want to know how to change some preferences on that profile multiple times, or how to change the profile after launching the driver? here is my code for setting up the profile: profile = webdriver.FirefoxProfile() profile.set_preference('browser.download.folderList', 2) profile.set_preference('browser.download.manager.showWhenStarting', False) profile.set_preference('browser.helperApps.alwaysAsk.force', False)

Python and selenium: how to change Firefox's profile multiple times

耗尽温柔 提交于 2021-01-29 06:23:24
问题 I set up Firefox's profile and launched the driver with that profile, after that, I want to know how to change some preferences on that profile multiple times, or how to change the profile after launching the driver? here is my code for setting up the profile: profile = webdriver.FirefoxProfile() profile.set_preference('browser.download.folderList', 2) profile.set_preference('browser.download.manager.showWhenStarting', False) profile.set_preference('browser.helperApps.alwaysAsk.force', False)

How to scrape the Javascript based site https://marketchameleon.com/Calendar/Earnings using Selenium and Python?

谁都会走 提交于 2021-01-29 06:18:43
问题 I am trying to get earning dates from https://marketchameleon.com/Calendar/Earnings The site has a javascript loader that loads the earnings table, but when I am using selenium it is not appears. I tried chrome and firefox drivers. a sample of the code: firefox_driver_path = os.path.abspath('../firefoxdriver_win32/geckodriver.exe') options = webdriver.FirefoxOptions() options.add_argument("--enable-javascript") driver = webdriver.Firefox(executable_path=firefox_driver_path, options=options)

Python & Selenium Clicking on td value in a row based on another td in the same row

橙三吉。 提交于 2021-01-29 06:01:13
问题 I'm trying to find out how to right click on a td based on a value in another td. Starting with the code below was just trying to find an initial cell and click on that value. If I could get that to work I wanted to right click on a value in the same row that has the text "Requested". The table is dynamic so the columns could be in any order. So for example. Find the name "Howard Johnson" and then right click on the requested value in the state column. (see attached image) The output is -

Why chrome doesn't show save password or remember password option while running automation script?

坚强是说给别人听的谎言 提交于 2021-01-29 05:51:09
问题 While automating with selenium if a username and password is entered why doesn't chrome browser show the option to save credentials as it does in regular practice. 回答1: As mentioned in previous answer, new instance of WebDriver opens fresh browser window, without previous cookies etc. What could you do is: When you first start WebDriver and open login page, using selenium enter credentials, make sure you check "remember details" checkbox is present. Now once you are logged in, you can get

Waiting until text to be present in element is NOT the string provided

匆匆过客 提交于 2021-01-29 05:41:52
问题 I'm looking for a way to have selenium webdriver wait until the text present in the element location I'm interested is NOT the string provided in the code below. wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//*[@id=\"order-details\"]/div[2]/div/dl/dd[1]/div"),"Completed successfully")); I'm looking for a way where the "text to be present" is not "Completed successfully" so that the code can move forward and no longer wait 回答1: You can try with ExpectedConditions -