Debian Programming :: Python - Selenium Script Migration

Apr 3, 2014

I have a code that uses the Firefox webdriver with Selenium to execute a couple javascript commands and fetch me some info. Since Debian doesn't use Firefox by default, and Selenium doesn't recognize Iceweasel as the equivalent of Firefox (which may be reasonable, but still kinda dumb), I downloaded and extracted the firefox-28.0 bz2 folder to my desktop. Next, I used the top answer suggested here to point Selenium to the binary:

Code: Select allfrom selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
[...]
binary = FirefoxBinary('~/firefox/firefox-bin')
driver = webdriver.Firefox(firefox_binary=binary)

However, it results in this error message:

Code: Select allTraceback (most recent call last):
  File "./seltest.py", line 19, in <module>
    driver = webdriver.Firefox(firefox_binary=binary)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
    self.binary, timeout),

[Code] ....

Did I set the binary path incorrectly or something?

View 9 Replies


ADVERTISEMENT

Programming :: Selenium Not Working With Java TestNG?

Oct 5, 2010

i am doing GUI automation testing of my product with selenium-grid-1.0.8 i have tried it with Perl & Java. with Java i am getting error

com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://20.20.0.1/ Response_Code = 403 Error_Message = Forbidden
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProc essor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)

[code]...

After this error my test case getting stopped. In perl i am getting this error but it is working fine.

# Error requesting http://localhost:4444/selenium-serve...b4d5d1bf9ed2e:
# XHR ERROR: URL = http://10.20.20.181/corporate/webpages/login.jsp Response_Code = 403 Error_Message = Forbidden

and i have to do this automation by java but i could not go ahead due to this error in java.

View 2 Replies View Related

Programming :: Selenium Java Code Into Equivalent Php Code?

Mar 30, 2011

I need to rewrite the selenium java code into its equivalent php code.

View 5 Replies View Related

Debian Programming :: Crontab Python Script Will Not Run

Oct 10, 2014

This python script works , but not from crontab.Here is my python script:

#more datetimedir.py
import os, datetime;
datestring = datetime.datetime.now().strftime("%Y%m%d_%H%M%S");
print (datestring);
os.mkdir(datestring);

Here is how I call it from crontab

*/30 * * * * /usr/bin/python3 /home/cwc/logs/datetimedir.py

View 2 Replies View Related

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

Debian Programming :: Implementing PyGtk For Python 3.3 In Wheezy

Sep 12, 2013

I run Wheezy Xfce 64-bit. I went through the Synaptic listings and added Python 3.3.2 and Tkinter for it, and that works fine; but for some reason PyGtk is available only for Python 2.7, not for Python 3.3, unless I'm just using the wrong way to try to find it. Is there a PyGtk available for Python 3.3 in Wheezy, and, if so, how do I install it and then import it once it's installed?

View 1 Replies View Related

Debian Programming :: Python - Unable To Install Matplotlib

Jul 16, 2015

I am unable to install matplotlib. I already have installed latest libfreetype and libfreetype-dev.But it still errors out on freetype, I am running Debian testing on my machine. Python is latest 3.5.b3 compiled from source and in virtual env , running the command :

pip install matplotlib

...... freetype: no [Requires freetype2 2.3 or later. Found ...] png: yes [version 1.2.50] ..... .....

* The following required packages can not be built: * freetype ....

Full error log here: [URL]....

I do not understand why requirement is not marked for compilation even though found.

View 5 Replies View Related

Debian Programming :: Searching For A List Of Strings In File With Python

Oct 14, 2013

I'm trying to search for several strings, which I have in a .txt file line by line, on another file.

So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt.

So far, I've been able to do this, to search for individual strings:

Code: Select allimport re

shakes = open("output.csv", "r")

for line in shakes:
    if re.match("STRING", line):
        print line,

How can I change this to input the strings to be searched from another file?

So far I haven't been able to.

View 3 Replies View Related

Debian Programming :: Return How Many Items Occurs In List (Python)

Jan 29, 2014

I going through the Python course on Codeacademy. I have some trouble understanding what I'm doing wrong. This is my code below:

Code: Select alldef count(sequence, item):
    total = 0
    for x in sequence:
        return x
        if x in sequence:
            total += 1
    return total
print count([1,2,1,1], 1 )

The code gives me an error: "Oops, try again. Your function fails on count([1],7). It returns 1 when it should return 0."

It should be outputting 3 because 1 occurs 3 times in the list.

View 7 Replies View Related

Debian Programming :: Packaging Shared Library With Python Wrapper

Apr 12, 2014

I have written a shared library and successfully used debhelper 9 to create a Debian package from source using a Makefile generated by cmake. I then went about writing a python wrapper to that library and wish to package that wrapper in with the library so I can have a single distributable rather than 2 separate ones.

All of my attempts so far have me placing my python source and a setup.py file in the same directory as the makefile at the time where I call debuild.

From here I have tried a couple different configurations to my debian/rules file as seen below:

Attempt 1:
# -*- makefile -*-
%:
dh $@ --with-python2 --buildsystem=python_distutils

This try seemed to package up the python stuff nicely but proceeded to ignore my makefile for the shared library and therefore ultimately failed.

Attempt 2:
# -*- makefile -*-
%:
dh $@ --with-python2

This try ran make, but completely ignored the python stuff. From some research I have gathered that the --buildsystem flag tells debuild to ignore any makefiles in the directory, which obviously causes a problem in my case.

Another attempt was to modify the build dependency to first run make and then call the python build process that file looked like this

Attempt 3:
# -*- makefile -*-

build:
dh $@
dh $@ --with-python2 --buildsystem=python_distutils
%:
dh $@ --with-python2 --buildsystem=python_distutils

This appears to somewhat work as both processes do build, but a few of the python files are still not getting installed.

Is this the way I should be going about doing this? I've noticed that most python wrappers tend to package themselves individually and then make that package dependent on the library it is attempting to wrap.

View 0 Replies View Related

Debian Programming :: Python-TK Alloc - Invalid Block Error

Sep 23, 2015

Just installed Debian 8 last night and trying to run one a few of my scripts that use easygui (a front-end for python-tk basically) and I keep getting alloc: invalid block any time a file or folder selection dialog is presented. I'm able to select a file/folder with no issues, but once the dialog closes I get a variation of what appears to be a memory error followed by alloc: invalid block.

Here's one of my scripts that does it. This one pops up a file selection dialog pretty early on to ask for a file to check, and as soon as I select any file the dialog closes and that error appears in the terminal. It happens whether I run it with Python 2 or Python 3. You will need to install python3-easygui for this script to run properly if you want to check for yourself what happens. This is a first time encountering this error for me.

View 1 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

Debian :: Best Way To Migration Etch To Lenny?

Mar 16, 2010

actually my Debian is still in Etch stable version. What is the best way to migrate to stable lenny version

My understanding was :

replacing Etch links in sources.list with Lenny links perform aptitude update & aptitude safe ugrape.

View 1 Replies View Related

Debian Programming :: Emacs And ECB Missing Python Methods In Methods Window

May 12, 2014

I work with python and I use emacs as my IDE tool. I have been running Debian Squeeze (6.0.9) for some time now with emacs 23.2.1 and ecb 2.32. I am able to access my python methods in the ecb-methods window with no problems. However I recently upgraded my desktop to Debian Wheezy (7.5) running emacs 23.4.1 and ecb 2.40 but I have lost access to the methods in the ecb-methods window. The window is just empty while the others (directories, sources and history) are all populated. I have a second laptop which I decided to upgrade to Debian Jessie, however Jessie recommends emacs 23.4.1 which is running with ecb 2.40 also. The result is the same as on Wheezy.

I have used the ecb menus and googled for a solution or even just a mention that such a problem exists but have come up with nothing. Either I have a unique situation here or am doing something really dumb.

I would like to upgrade to Wheezy or Jessie but I need access to methods in the ecb methods window. How to keep my upgrade and see the methods in the methods window of the ecb system ....

View 0 Replies View Related

Debian Installation :: Migration From Lenny 32 Bit To 64bit

May 13, 2010

currently I'm running postgresql-8.3 server on lenny 32 bits. There are also installed some standard packages but in the near future I'd like to install mysql server on the same machine. I believe that 64 bit system will be faster so I decided to change from 32 to 64 bit. how to migrate postgresql database from 32 to 64 bits. I have postgresql data dir on separate volume. Will it be possible if I just use it as it is now in new 64 bit system with the same postgresql server config files or do I have to dump data and restore it in new installation ?

View 1 Replies View Related

Debian Configuration :: Migration To Bind 9.10 In Wheezy 7.1

Nov 13, 2015

I want to migrate to bind 9.10 in debian wheezy. I don't want to take the source code from debian Sid since its an experimental version. So I have taken source code from official bind forum and compiled in debian wheezy. The compilation is successful but I am having problem in running the binary in debian wheezy. It's not honoring the binary even though I run it. I am not getting error messages on console but still it is not running.

I want to know whether its feasible to do this Or is it dependent on any other system libraries to make it run ?

Last few lines from Strace Dump
==============================

capget(0x20080522, 0, NULL) = 0
capget(0x20080522, 0, {0, CAP_CHOWN|CAP_DAC_READ_SEARCH|CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE|CAP_SYS_CHROOT|CAP_SYS_RESOURCE, 0}) = 0
getuid() = 1007

[Code] .....

View 1 Replies View Related

Programming :: Totem Python Plugin Programming: Any Signal For Video Mouse Click?

Feb 9, 2011

I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":

Code:
vd = totem_object.get_video_widget()
vd.connect("clicked", vd.hide)

[code]....

View 3 Replies View Related

Server :: Running Selenium Test Scripts Headless?

Nov 24, 2010

I need to run "Selenium" test scripts (written inside TestNG) on a headless linux server (Red Hat Enterprise Linux Server release 5.3) using Xvfb. while executing the script, I get the following warnings in the "server.log" file.Warning: Cannot allocate colormap entry for "#c0c0c0"Warning: Cannot allocate colormap entry for default background.This warnings occurs when the script try to launch Firefox. Firefox is not getting launched and the code gets hanged in the middle, without executing any test case.I suspect the problem could be with the Xvfb's screen resolution. screen resolution might be lesser than firefox'sexpected resolution.we can be able to specify our own display in POM file using <display> tag.

View 2 Replies View Related

Debian Configuration :: Live Migration To Ext3 To Ext4 On A LVM2 System

May 5, 2011

I have successful upgraded my system from Lenny to Squeeze and have even installed NVIDIA Driver successful, as well as other applications that I need. My system is now running smoothly and okey. My applications are also running smoothly except Skype 2.2 (Debian Forum Guys are currently helping me solve it).

However, I do want to upgrade my file system to ext4 in order to take its advance features and advantages especially that my system is now in WORK HORSE mode. However, I am not confident enough to do it because the guide is limited and does not tackle the issue of a system using ext3 with LVM2 on it.

Therefore, my question is how do I migrate (LIVE) my Ext3 to Ext4 on my system that uses LVM2? A clear and understandable guide is highly appreciated especially that I am newbie on it.

View 2 Replies View Related

Programming :: Python 2.x Vs 3.x

Apr 21, 2010

I'm starting to learn python and I am wondering whether I should start with python 2.x or should I just start learning python 3.x?

View 2 Replies View Related

Programming :: Convert Map From Python 2.x To 3.x

Apr 6, 2010

I have an existing line of code from a P2 script that I cannot find a solution to converting to P3:

Code:
for i, x in map(None, list1, list2):
I have found the information about converting the simple case:
map(None,x) becomes list(x)

But my googling was unable to find a solution when more than one iterable exists.

View 2 Replies View Related

Programming :: How To Run Python Script From C

Jan 31, 2010

I have a python script I wrote a while ago and now I would like to call that script from inside C. I know how to do one command from C, but how would you execute an entire script from C, and passing arguments? Like:

Code:

int main(void)
{
python( myprogram(1 2 3) );
}

So I can pass arguments to my script.

View 3 Replies View Related

Programming :: Py_FindMethod In Python 3.1.1

Jan 19, 2010

what the equivalent function in Python 3.1.1 is for Python 2.6.4s:

Py_FindMethod

Be buggered if I can find anything in the doco to say what replaced it or what alternative code may need to be entered to replace it

View 1 Replies View Related

Programming :: Python With Web Development ?

Dec 17, 2010

I have decided to learn python as it seems to be powerful not just for web development (like php) but also a clean powerful language for other puposes.

Q: Can someone suggest a tutorial or book, on learning python (beginner to intermediate) which has as its focus for learning, web development?

In order of preference: 1. Comprehensive, 2. Online, 3. Free

View 2 Replies View Related

Programming :: Piping In Bash Using Python?

Dec 16, 2010

I have a bash script that I want to import in to Python, mainly just to see if I can or not. However in the script I do use some piping of commands into sed to trim it down to what I need. When I tried doing it with the os.system() call, it didn't work. The exact error is

sed: -e expression #1, char 16: unterminated `s' command

However the command that was run can be run in bash without an error. Is there a better/another way to do this? For reference the command is:

Code:

locate -n 1 wp-config.php | sed 's/wp-config.php/
/g' | sed '/wp-config.php/ d' | sed '/^$/ d'

View 3 Replies View Related

Programming :: Accessing Python Scripts Using Web?

Mar 17, 2011

I am using Centos. I have written some scipts in python that access my routers and fetch the configuration, etc. Now i was thinking of creating a web interface which i can access from my windows XP. I want it to have good look n feel :-),

View 7 Replies View Related

Programming :: C++ Or Python - Create 3D Animation ?

Jan 25, 2009

I want to create 3D animation and also make some big programs. Is python capable of that? or should I stick to C++?

View 3 Replies View Related

Programming :: Linking Options For Python?

Dec 11, 2010

I am trying to build an application that must link with python so as to load a python module during runtime.I have this makefile :

Code:
[alex@iskandhar src]$ cat Makefile
CFLAGS = -Wall -O3 -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK

[code]....

View 4 Replies View Related

Programming :: List Sorting In Python?

May 10, 2011

I have a list of list and I'd like to sort the list according to the last value of each row.

Let's say we have the list

L1 = [ [1,2] , [4,6] , [78,-3] ]

I wish to get

L2 = [ [78,-3] , [1,2] , [4,6] ]

Is there a simple way to do that in python?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved