I have a script that posts data to a third party form via PhantomJS.  It 
runs just fine on selenium in the python shell and when I run it in the W2P 
shell (python web2py.py -S *app* -M).  The problem is that when I call it 
from the controller via a click, I get this traceback.

I am assuming that the process is somehow interfering with itself but Ive 
spent 24 hours googling and found nothing.  Anyone have any thoughts?

====


1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 227, in restricted
    exec ccode in environment
  File "/home/www-data/web2py/applications/t4/controllers/default.py" 
<https://104.131.18.58/admin/default/edit/t4/controllers/default.py>, line 
5172, in <module>
  File "/home/www-data/web2py/gluon/globals.py", line 412, in <lambda>
    self._caller = lambda f: f()
  File "/home/www-data/web2py/gluon/tools.py", line 3774, in f
    return action(*a, **b)
  File "/home/www-data/web2py/applications/t4/controllers/default.py" 
<https://104.131.18.58/admin/default/edit/t4/controllers/default.py>, line 
4891, in file_now
    driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true', 
'--ssl-protocol=TLSv1'])
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/phantomjs/webdriver.py",
 line 52, in __init__
    self.service.start()
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", 
line 86, in start
    self.assert_process_still_running()
  File 
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py", 
line 99, in assert_process_still_running
    % (self.path, return_code)
WebDriverException: Message: Service phantomjs unexpectedly exited. Status code 
was: -11



============


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re
from selenium.webdriver.support import expected_conditions as EC


driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true', 
'--ssl-protocol=TLSv1'])
driver.get(*website*)
driver.find_element_by_name("login").clear()
driver.find_element_by_name("login").send_keys(*thing1*)
driver.find_element_by_name("key").clear()
driver.find_element_by_name("key").send_keys(*thing2*)
driver.find_element_by_name("redaction").click()
driver.find_element_by_name("button1").click()
driver.find_element_by_link_text("Bankruptcy").click()
driver.find_element_by_link_text("Case UpLoad").click()
#driver.find_element_by_name("case_1").clear()
driver.find_element_by_name("case_1").send_keys(hardpath+dox.case_information)
#driver.find_element_by_name("file_1").clear()
driver.find_element_by_name("file_1").send_keys(hardpath+dox.petition)
#driver.find_element_by_name("file_1_MTX").clear()
driver.find_element_by_name("file_1_MTX").send_keys(hardpath+dox.creditors)
#driver.find_element_by_name("configured_file_1").clear()
driver.find_element_by_name("configured_file_1").send_keys(hardpath+dox.ccc)
driver.find_element_by_name("button1").click()
driver.find_element_by_name("button1").click()

print driver.page_source

return driver.page_source

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to