685 reputation
57
bio website
location
age 27
visits member for 3 years, 4 months
seen Sep 5 at 14:21

Mar
28
comment What is the correct way to select an <option> using Selenium's Python WebDriver
@ChrisB you are correct that his solution is better, however I am fairly certain that when this was response was written the Select function did not exist :)
Jul
24
comment What is the correct way to select an <option> using Selenium's Python WebDriver
@abhi Make sure you are using find_elements_by_tag_name and not find_element_by_tag_name (The s in elements matters).
Dec
2
comment Can't open webpage using Firefox WebDriver using Selenium
What version of selenium are you using here?
Nov
9
comment Can't click this checkbox using WebDriver / Selenium — ElementNotVisibleException
Selenium calculates which elements are visible based on when they are used. If Selenium is telling you the element is not visible, but it looks like it is actually visible, it is almost certainly a timing issue and can be fixed by doing what is shown in my initial answer.
Nov
1
comment Can't click this checkbox using WebDriver / Selenium — ElementNotVisibleException
The element does have a method called is_displayed. I have a function that will sleep at half second intervals until something occurs. In this case it would be half second intervals until your element is displayed. If you do take that approach make sure to give the timeout function a maximum time, otherwise if the element is never displayed, the test will hang indefinitely.
Nov
1
comment Can't click this checkbox using WebDriver / Selenium — ElementNotVisibleException
I have never had much luck with the WebDriverWait. I suggest just making a simple timeout function that will loop a couple of times and sleep between each iteration, checking to see if the element is visible yet.
Jul
7
comment What is the correct way to select an <option> using Selenium's Python WebDriver
I just saw that you had answered your own question, oops :)
Jul
1
comment WebDriver login and click action ain't working…
I am actually not sure you can run headless Firefox on a Windows box, but if you could it would be your best bet.
Jun
30
comment switching windows with Selenium2 and c# where popup window has same title as originating window
Back before Selenium 2 could deal with alerts we used to have to call self.driver.execute_script('window.onbeforeunload = function(){};') (sorry its python bindings) in order to prevent the alert from showing up when we were trying to change pages without saving. Its a simple example, but I feel you will be able to do something similar
Jun
30
comment switching windows with Selenium2 and c# where popup window has same title as originating window
Sure, for a basic overview there is some at Selenium FAQ and for a more in-depth explanation you can use JavascriptExectutor API.
May
10
comment Attach to browser not spawned by Selenium2
IE uses a dll and chrome uses a zip file.
May
10
comment Attach to browser not spawned by Selenium2
I do not think you can attach to a browser not spawned by the driver. Tarun's solution will only allow switching to and from browsers spawned by that particular driver
May
9
comment Maintaining automation framework for different browsers like IE and FF
In my experience if it works in IE it will work in firefox. As such, in order to not have two sets of commands (one for firefox and on for IE), I try to convert to using DOM values consistently. On a side note, xpath is really difficult to use and not have to update for simple changes anyway. Hope that helps, if not let me know.
May
6
comment Which locator do you use with Selenium CSS or XPath?
I agree with @CBA whole completely. We had originally used xpath for all of our selectors, and it quickly became apparent that using the class_name or id was the only way to write the tests in such a way that they would not need to be fixed for any small change to the html
May
3
comment Building “slow to break” regression tests
PageObjects are pretty much your best bet. Just make it easy to change how you are getting or defining an element. We have a dictionary for each page that pairs a key with a tuple. The tuple consists of how we want to select the element (id, xpath, class_name), and then the actual selector needed to achieve that. The hardest part is defining elements in such a way that little changes will not force a re-write. The worst thing you can reference things by is xpath.
May
3
comment When to start testing a solo project
In my opinion it is much better to name tests based on what they are testing. If test_1234 fails, you don't have any idea what is wrong with it. But if test_approve_document fails, then you have a pretty good idea of what might be broken.