ghostdriver

Bind Phantomjs to a Network Interface

喜你入骨 提交于 2020-01-17 03:44:30
问题 I currently have multiple network alias (eth0, eht0:1, eth0:2), each having their own private ip which has its own public ip. When using remote web driver with phantomjs (ghostdriver), it always chooses the local host (See BUG https://github.com/ariya/phantomjs/issues/10269), for client argument --webdriver=ip:port, thus I cannot rely on phantomjs to pick the correct interface. I am currently under the impression that I will have to use IPTABLES. I want to route ever instance of my java

PhantomJS file upload fails if file is larger than 20000 bytes

帅比萌擦擦* 提交于 2020-01-03 05:33:34
问题 I have discovered a really strange problem when using PhantomJS with Selenium to upload a file. I noticed, that smaller files can be uploaded, while larger files can not. So I ran a binary search to find out at which filesize it stops working. This revealed that every file bigger than exactly 20000 bytes fails to upload. Since it's not a power of two I guess this limit was set by someone, for some reason, within the whole stack of phantomJS, Ghostdriver or Selenium. I have spend hours pinning

Using phantomjs for dynamic content with scrapy and selenium possible race condition

笑着哭i 提交于 2019-12-31 22:57:14
问题 First off, this is a follow up question from here: Change number of running spiders scrapyd I'm used phantomjs and selenium to create a downloader middleware for my scrapy project. It works well and hasn't really slowed things down when I run my spiders one at a time locally. But just recently I put a scrapyd server up on AWS. I noticed a possible race condition that seems to be causing errors and performance issues when more than one spider is running at once. I feel like the problem stems

Selenium webdriver java - upload file with phantomjs driver

China☆狼群 提交于 2019-12-25 01:01:05
问题 I am running a selenium webdriver script headless using Phantomjs Driver. I am having issues uploading a file though since on a normal browser (firefox or chrome) it would pop up the OS dialog box that would allow me to locate the file in my machine and upload it. How to do that with the ghostDriver (Phantomjs Driver)? Thanks 回答1: Always identify & interact with elements of type "file" when uploads are concerned. This would solve your issue of pop ups. Ex: In my application, upload related

getting error: Could not start Ghost Driver

别等时光非礼了梦想. 提交于 2019-12-24 05:12:08
问题 I'm trying to run Ghostdriver inside my Openshift server. As i run this command: ./phantomjs --webdriver=15002 It says: PhantomJS is launching GhostDriver... [ERROR - 2014-08-01T04:14:21.160Z] GhostDriver - main.fail - {"message":"Could not start Ghost Driver","line":82,"sourceId":139887801789952,"sourceURL":":/ghostdriver/main.js","stack":"Error: Could not start Ghost Driver\n at :/ghostdriver/main.js:82","stackArray":[{"sourceURL":":/ghostdriver/main.js","line":82}]} $ ./phantomjs --version

Running ghostdriver using java gives error

笑着哭i 提交于 2019-12-23 04:06:33
问题 I am using remote ubuntu machine to run my test cases. I have jenkins configured with github. I can access this machine using putty.exe using my windows7 machine. I want to use phantomjs to run headless test cases (schedule jobs)i.e. when my windows machine is off the tests will run on remote ubuntu machine which is always on. Now the problem is , when I am build now it gives error : Caused by org.openqa.selenium.HasInputDevices ... ... My setup() method and pom looks like : setup()

PhantomJS Proxy when using Remote Webdriver?

若如初见. 提交于 2019-12-23 03:35:29
问题 I am trying to use selenium in python with PhantomJS. I am running a selenium hub server so am using webdriver.Remote to start a webdriver. The normal way to pass a proxy to PhantomJS is: service_args = [ '--proxy=127.0.0.1:9999', '--proxy-type=socks5', ] browser = webdriver.PhantomJS('../path_to/phantomjs',service_args=service_args) This won't workthough for webdriver.Remote(service_args=service_args) As webdriver.Remote takes only desired_capabilities, not service args, as a parameter. Is

Is there a way to view PhantomJS console.log messages via Selenium/GhostDriver?

跟風遠走 提交于 2019-12-21 03:48:27
问题 I'm using the Java bindings of GhostDriver to run Selenium acceptance tests against PhantomJS. If one of the web pages requested by PhantomJS logs to the Javascript console via console.log, is there a way to capture or view those messages? I'm guessing that the answer to this is forehead-slappingly simple but I can't work it out! 回答1: LogEntries logs = driver.manage().logs().get("browser"); 来源: https://stackoverflow.com/questions/19225532/is-there-a-way-to-view-phantomjs-console-log-messages

selenium.common.exceptions.WebDriverException: Message: 'Can not connect to GhostDriver'

匆匆过客 提交于 2019-12-20 10:29:19
问题 I'm trying to run PhantomJS from within selenium.webdriver on a Centos server. PhantomJS is in the path and is running properly from terminal. However in the script it appears to be launched, but afterwards cannot be reached on the specified port (I tried 2 different opened ports from my provider 29842 and 60099, they both are not working and neither launching it without a specified port). The error happens here in selenium.webdriver.common.utils : try: socket_ = socket.socket(socket.AF_INET,

Handling Redirection w/ PhantomJS + Selenium

拈花ヽ惹草 提交于 2019-12-19 03:37:14
问题 I currently run browser tests via PhantomJS + Selenium in Python. desired_capabilities = dict(DesiredCapabilities.PHANTOMJS) desired_capabilities["phantomjs.page.settings.userAgent"] = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36") driver = webdriver.PhantomJS(executable_path="./phantomjs", desired_capabilities=desired_capabilities) driver.get('http://google.com') This works fine, unless the page I'm trying to get