Tag Info

New answers tagged

0

Selenium tests are always run against a browser. HTMLUnit mimics a browser in a headless form. Running tests against a headless browser is great for faster feedback during development, but in the long run you will want to run your tests against real browsers to find browser compatibility issues. Did you try PhantomJS, its a headless webkit browser. I know ...


0

Selenium IDE is not a reliable way to create tests. It would be a maintenance nightmare. You might be better of using the webdriver package as such. It supports multiple programming languages. If you know Java, Python or C#, you should be able to pick it up in a day. Most QA teams forget that test automation is software development after all. Let me know if ...


0

The height is calculated using getCssValue("height") property. I am not sure if it is the correct way to limit the count or is there any function which can limit rows? I am able to use table.size() to get the count of the rows which includes rows in the dialogbox (after scrolling down the dialog) whereas I want rows only screen on top without scrolling.


0

Do the elements have a VisibleOnScreen property? Or if you have access to the height property you can delete from the list the ones that don't matter... I'm just fishing here, never used it before...


0

It turns out i was able to find the problem by myself, it was not at all in the above snippet of code. if i[1] == "id_text": inst = driver.find_element_by_id(i[2]) #inst.click() for option in inst.find_elements_by_tag_name('option'): if option.text == i[3]: option.click() This above code was inside of a function ...


0

What is stored inside id[2]? If it has \' instead of ' then removing the \ might solve your problem.


1

WGet is a command-line tool used to download files. Here's a good tutorial on how it works; you'll need to call out to the command line from inside your test and execute wGet, then check the file it downloaded. How you do this differs depending on your setup (Java vs C#, Windows vs Linux, et cetera). Basically you want to execute the command wget ...


0

I was plagued with a similar issue, but I think I have now solved it. The tests would invariably run perfectly in the IDE (Eclipse) but would usually (but not always) fail with the above error message when run from Jenkins. The application under test is very slow and has some Javascript making AJAX calls on each page which don't help. The test was failing ...


0

It appears on your site that the credit card form is loaded asynchronously meaning it may not be there if you don't have some kind of wait command. In the IDE you can add a command waitForElement and put your dropdown element identifier (id=cc_type_braintree_basic) so that it will wait for the element to be rendered before it tries to interact with it. ...


1

Three possibilities: The IDE inputs (e.g. arguments and environment variables) are not the same as the command line inputs. You can check that with print statements or logging. The libraries are not the same. I assume you know how to check this. You found a timing problem. To check this, first determine which element is erroring out, then try waiting ...


0

When I work with Selenium and drop downs, it usually looks like the following: command: select target: id=DropDownId value: label=label_id or value=Values_name


-2

<tr> <td>open</td> <td>/config/login?.src=fpctx&amp;.intl=us&amp;.done=https%3A%2F%2Fwww.yahoo.com%2F</td> <td></td> </tr> <tr> <td>type</td> <td>id=username</td> <td>your yahoo email</td> </tr> <tr> ...


2

driver.findElements(By.name("vehicle").click(); int i = 0; for (WebElement we:driver.findElements(By.name("vehicle")) { if (we.isSelected()) { i++; } } System.out.println(i + " Number of check boxes present in the page"); That should give no issues. But you are looping through an entire list to always come to the same answer, 1.


2

I'm no wizard when it comes to actually coding this, but I used to inject variables with JS into Selenium IDE (back in the day) that would collect certain actions a they were performed. Perhaps you can use the action for clicking the checkbox to increase a simple count variable to use in your script above?


0

Hi @StacyM he is talking about the path C:\Python27\Lib\site-packages\selenium\webdriver you can place the android file there. Also in your __init__.py file you can add the line from android.webdriver import WebDriver as Android if what I have read is correct. Maybe @Sean can confirm this? EDIT: I did get this working by removing my old Selenium, unpacking ...


0

Plan plan plan!!! The greatest cost of automated tests is maintenance, and as the project grows it gets more and more difficult to do if the proper amount of planning wasn't utilized during the initial design of the test project. Whether an application is still under development or not, the first thing you should do (if you don't have one already) is write a ...


2

Explicit and Implicit Waits wait.until(condition) waitForElementPresent(locator) driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); More information here: Advanced Webdriver Usage with "implicit waits"


3

For really good, robust, maintainable UI automated regression, you need code. Using screenshots is bad for several reasons: Even with a fuzz tolerance built in to prevent things like the exact color of the display throwing false positives, there are too many trivial things that can throw a false positive. A change of display resolution will utterly destroy ...


0

IMHO it is not always a good idea create tests based on UI, they are really hard to maintain, btw for your case you can have a look at SIKULI, it is an UI automate testing tool, it is perfect for your goal.


1

There are two parts to this. The first is that you need to be sure that your xPath is correct. One way to validate that is to use a tool like Firefinder (a firefox extension for firebug). Navigate to your page and be sure the element you need is present and then hit f12 and go to the FireFinder section. Enter in the xpath you are using and see if it can ...


1

Can you find it if you use the .Text and then clicking it if it matches? String Expectedtext = "Procurement" String ProcurementButtonText = driver.FindElement(By.XPath("//td")).Text; if (ProcurementButtonText == Expectedtext) { driver.FindElement(By.XPath("//td")).click() }


0

If could you try updating your for loop so it breaks out if the element you are iterating through is present. for (int i = 1; IsElementPresent(By.ClassName("datepickerSunday")")) == true; i++) { what your are looping This might also help reduce the number of waits you are using p.s. if you put your question outside the ...


1

You can have a look on Karma which is based on NodeJs and specifically designed for AngularJs. http://karma-runner.github.io/


0

driver = webdriver.Firefox() languages = ['pol', 'eng', 'ger'] `#in html looks like <option value="eng">eng</option>` for lang_select in languages: select = Select(driver.find_element_by_name('lang')).select_by_value(lang_select)


0

Not quite the same problem, but since I found this answer when googling, I'm providing my solution here too. I'm trying to find the firefox executable to execute it from scripts like cucumber / selenium tests without hardcoding the path. Here's what I do: Find it with Spotlight firefox_paths = %x[mdfind "kMDItemFSName = Firefox.app"] firefox_path = ...


0

You probably need to use a Selenium JavascriptExecutor and call the command to get focus using JavaScript. If your Firefox was in non-native selenium events mode, then this would make sense. I would try Selenium 2.40.0 with Firefox 27 though, with native events enabled, just to see what happens, otherwise use the JavascriptExecutor as a workaround. I ...


0

This is an old thread, but now you can use Protractor, which is a C# port of original one Install-Package Protractor and it has a dependency on Selenium.WebDriver Install-Package Selenium.WebDriver


1

I often put common helper code into a base class. Mostly I do that only for "general purpose" helper code, like logging in, starting and stopping Selenium, dependency injection, and stuff like that. For helper code related to functionality (like selecting or searching or purchasing flights), I always put that not in a base class, but in a delegate class. ...



Top 50 recent answers are included