webdriver

How to selecting option from right click menu with Selenium

微笑、不失礼 提交于 2021-02-11 11:53:19
问题 I'm using chrome as the driver and after double-clicking/context-clicking, the prompt window opens but the driver won't switch to the prompt window. Here is what I have tried... The page I am opening is google.com, search, then trying to right-click so i can open the results in different tabs. Thanks in advance. ....... element = driver.find_element_by_class_name("LC20lb") actionchains = ActionChains(driver) actionchains.context_click(element).perform() # Driver needs to switch to the popup

Saving Image from URL using Python Requests - URL type error

折月煮酒 提交于 2021-02-11 06:55:02
问题 Using the following code: with open('newim','wb') as f: f.write(requests.get(repr(url))) where the url is: url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAArCAYAAAD41p9mAAAAzUlEQVR42u3awQ4DIQhFUf7/p9tNt20nHQGl5yUuh4c36BglgoiIiIiIiGiVHq+RGfvdiGG+lxKonGiWd4vvKZNd5V/u2zXRO953c2jx3bGiMrewLt+PgbJA/xJ3RS5dvl9PEdXLduK3baeOrKrc1bcF9MnLP7WqgR4GOjtOl28L6AlHtLSqBhpooIEGGmiggQYaaKCBBhpodx3H3XW4vQN6HugILyztoL0Zhlfw9G4tfR0FfR0VnTw6lQoT0XtXmMxfdJPuALr0x5Pp+wT35KKWb6NaVgAAAABJRU5ErkJggg==' I get

How to launch all Karate features setting up which browser to use as an external maven variable

。_饼干妹妹 提交于 2021-02-10 23:17:36
问题 I was trying to find a way to launch all features in Karate testing through maven using an external variable to set up the browser (with a local webdriver or using a Selenium grid). So something like: mvn test -Dbrowser=chrome (or firefox, safari, etc) or using a Selenium grid: mvn test -Dbrowser=chrome (or firefox, safari, etc) -Dgrid="grid url" With Cucumber and Java this was quite simple using a singleton for setting up a global webdriver that was then used in all tests. In this way I

chromedriver.exe runs ~8 chrome.exe instances

懵懂的女人 提交于 2021-02-10 20:28:29
问题 I write UI automation tests using Selenium. And I noticed that when I create an instance of chromedriver.exe -> ~8 chrome.exe processes appear in the Task Manager. Task Manager screenshot when running 1 test: So, when I run in parallel, let's say, 8 tests there are a lot of chrome.exe instances in the Task Manager that use some ports and load a CPU and a memory. Does it work by design? Why so much chrome.exe instances are needed for one chromedriver.exe? Is this configurable? In my code, I

Capturing info from console using Python

删除回忆录丶 提交于 2021-02-10 14:16:28
问题 I'm creating a script where I'm trying to rip m4a files from a website specifically. I'm using BS4 and selenium for this purpose presently. I'm having some trouble getting the info. The file link is not located in the HTML source for the page. Instead, I can only find it in the console. The link I'm trying to get is here in this image (https://imgur.com/a/DLwcE0p) labeled "audio_url_m4a:". Here's some sample code I'm using: from selenium import webdriver from selenium.webdriver.common.desired

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('-

Codeception - Can't connect to Webdriver (Acceptance Test)

半腔热情 提交于 2021-02-09 09:20:44
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Codeception - Can't connect to Webdriver (Acceptance Test)

江枫思渺然 提交于 2021-02-09 09:20:20
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Selenium: how to click on javascript button

非 Y 不嫁゛ 提交于 2021-02-08 23:45:05
问题 I must write some scripts for automatic tests to check load-time a web application built in flex/amf technology. The test will consist in opening the IE browser, going through several tabs and measuring the time from clicking on the last tab to load the page content and then closing the browser. I wrote in java a small script with Selenium Web Driver and Junit. Script opening the IE-window, enter login and password. I have problem with 'click on' login-button. Firstly I have try to find and