Re: [BangPypers] selenium pyvirtualdisplay script on remote server

2011-10-06 Thread Senthil Kumaran
On Thu, Oct 06, 2011 at 10:23:17AM +0530, Saju M wrote:
 I already tested with scroll bar and focus and its working finw in my laptop.
 But when i run this script on Remote Server, it can't find that element.??

You could try putting some debugging prints in this script and what
the values are on local vs remote server. Personally, I could not see
any problem with the below script.

Print the values of display, driver and focus values. Introspect the
objects that you get.

Thanks,
Senthil
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


[BangPypers] selenium pyvirtualdisplay script on remote server

2011-10-05 Thread Saju M
Hi friends,

selenium pyvirtualdisplay script on remote server

Here the isuue is i can't find the li element. that is because that
element is out of display, so i adjust scroll bar or do focus around
that area to get that element via find_element_by_id(loc_opt)

I already tested with scroll bar and focus and its working finw in my laptop.
But when i run this script on Remote Server, it can't find that element.??

Note: Here i am using pyvirtualdisplay, Xvfb and Xephyr, because
server don't have Xserver.
Its also working fine with pyvirtualdisplay in my laptop. but the
issue is in Remote Server.

Has anyone faced this problem before ?

Please suggest a solution.

class Search:
def __init__(self):


self.display = Display(visible=0, size=(800, 600))
self.display.start()
self.url ='http://www.google.com'
self.search_url = None
self.driver  = webdriver().Firefox()

def search(self, search_query, search_location=None):


if search_query:
self.search_url = %s/search?q=%s %(self.url, 
search_query)
print \nURL : , self.search_url
self.driver.get(self.search_url)
self.submit_search()

#self.driver.execute_script(window.scrollBy(0,200))

self.driver.execute_script(document.getElementById('tbpi').focus();)
more_search_tools_link = 
self.driver.find_element_by_id(tbpi)
more_search_tools_link.click()
self.driver.execute_script(window.scrollBy(0,200))
loc_li = self.driver.find_element_by_id(loc_opt)
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers