Hot answers tagged selenium2
7
I suspect this is not a TestNG issue. I would start by trying to produce a minimal set of tests that, when run together, cause failures. After that, I would explore these possibilities:
Inter-test interaction changes test-application interaction: It is possible that interaction between your tests changes how your test interactions with your application. ...
7
These days, I'd say Selenium RC is not worth learning unless you have a specific need for it--for example, to work with legacy test code that uses it.
I don't think it will give you a significantly better appreciation of the Selenium architecture. You can get that by exploring the Selenium code base if you have an interest.
If you the know WebDriver API ...
4
Blobinator, welcome to SQA.
For the purposes of your question, it may help to think of a UI test as two overlapping activities: interacting (e.g. clicking/typing) and verifying (confirming that the site behaves correctly). Interacting and verifying overlap because it may not be possible to interact in the way you intended unless the site behaves correctly. ...
4
Quite simply No!
WebDriver was a project in its own right before it merged with Selenium so looking at the Selenium RC codebase and API is not going to give you any insight as to why certain decisions were made inside WebDriver.
Selenium RC is currently deprecated, so if you do start learning it you are learning something that is no longer supported and ...
4
In your comment you mentioned that the element is within a <frameset> \ <frame>. To work with any element within a frame, you need to first switch the context of the driver from the main page to that frame:
driver.switchTo().frame("foo");
In this example "foo" would be the name of the iframe. You can also do it by index if the frame has no name ...
3
Does the “select” control require refresh page? If so, you might have to add the following line inside WebDriverWait.
driver.navigate().refresh(); //refresh the page (java code. C# should have a similar function)
Also, you cannot use the both (Implicitly wait and WebDrvierWait ) inside the same test. You have to nullify ImplicitlyWait before ...
3
Maybe this question I asked several months ago on stackoverflow can do some help to you: http://stackoverflow.com/questions/9781940/selenium-vs-webdriver-any-obvious-advantages
Although I said I decided to use RC at that time, I turn to webdriver short after that. Yes, webdriver has problems, but it is upgrading time after time. I would rather try the new ...
3
Theoretically possible but practically too much work, example here of people trying it
https://groups.google.com/forum/m/?fromgroups#!topic/selenium-developers/rq1sQwUIJKM
3
I haven't used it, but possible it may be helpfull for you:
FiddlerCore
And one more alternative:
BrowserMob Proxy
3
This question comes up a lot. Here is a possible solution, but it will require some additional development. You could use a customized HTTP proxy that acts as a pass-through filter except when it sees an HTTP 401 response. In the latter case, the proxy would respond with authentication credentials of your choosing.
Here is how you might do it, in steps:
...
3
As user246 commented, you can write a method to locate the 'X' on the popup and click it if found. Then you can define a custom method to locate an element on the page, something like this (kind of pseudo code):
myFindElement(String xpath)
{
try{
driver.findElement(By.xpath(path))
}
catch (ElementNotFoundException e){
if ...
3
In the Selenium Simplified course the secret to the selector is really the 'value' not the 'type' as the 'value' identifies the WebElement uniquely on that page, coupled with a type 'just in case'
WebElement checkBox1;
WebElement checkBox3;
checkBox1 = driver.findElement(By.cssSelector("input[value='cb1']"));
checkBox3 = ...
3
From documentation:
BinaryLocation
Gets or sets the location of the Chrome browser's binary executable file.
So the above excerpt plainly says that the BinaryLocation is the path for chrome.exe and not chromedriver.exe.
And chromedriver.exe path should be defined in the PATH environment variable.
So in your case the correct line would be:
...
3
It's in git so you could do a sparse checkout to get the JavaDoc part of the repo only. This blog post about sparse checkouts goes through it in a reasonable amount of detail:
http://blog.quilitz.de/2010/03/checkout-sub-directories-in-git-sparse-checkouts/comment-page-1/#comment-3146
Or you could download them from maven central:
...
2
Interesting. I'd probably create a test that just navigates to the page and enters text into that texbox and repeat it a hundred times then watch the execution and see if I can catch it in the act to see what might be going on. It could be something to do with auto-complete, especially if that took focus away from the textbox. That could cause selenium to ...
2
Okay I just got it working under IE9 using C# and the following code:
IWebDriver driver = new InternetExploreDriver();
driver.Url("Site");
driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
And now it will go to the real page.
2
I found the same error and couldn't isolate it either. I basically wrote a wrapper for the sendkeys function which would check that the value entered was correct or would retry for 2 seconds. My code is in java but it would be easy to write it in another language. I see you have basically done the same thing though.
2
Depending on the implementation of your "other project" I would suggest that;
Change the external project to throw exceptions in the event of failure
Include a helpful error message, and some context about the current state of the method
Implement a post-test screenshot capture
We've implemented a JUnit Rule which extends TestWatchMan that runs after a ...
2
Use XPATH. Install a tool like FirePath to help yourself debug this, but you'll probably want something like:
select_finder = "//tr[contains(text(), 'Mahmoud')]//a"
driver.find_element_by_xpath(select_finder).click()
where the XPATH reads something like "find a table row which contains the text "Mahmoud", then find a hyperlink inside that row"
2
I can tell you what I do in this situation. I have not used the LoadableComponent, however what I have done has followed a similar pattern. I create classes for each of the "loadable components" that are basically page objects. I have something like the IsLoaded function to ensure that the component is loaded, and depending on how it works I either don't ...
1
I'm looking at this too. Seems there is a bit of problem in as_json in Selenium::WebDriver::Remote::Capabilities
firefox_binary get's re-written to firefoxBinary in the json call to webdriver grid, this means that the binary you have supplied does not register as it's assigned to the wrong key.
Chaning:
def as_json(opts = nil)
hash = {}
...
1
Selenium does function across both of those platforms using different drivers. But only for browser functionality.
For Android, there is support for a native automation using a tool very similar to Selenium, called Robotium: link They have some decent tutorials, example code and .apks and more there. It does take more foresight during development and ...
1
Please check
MonkeyTalk: open source functional testing platform for iOS and
Android - Link
Another interersting tool open sourced by twitter Clutch.IO - native A/B testing service for iOS and Android link
1
I have not used the java implimentation but can you utilize the ImplicityWait method to configure the timeout?
This is a c# example that gets set in the Setup stage of the unit test.
driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0,30));
This is the API doc for the method.
1
As far as I can tell, your question is more about Nose than Selenium. You want errors and failures to do something that successes do not. I do not have any experience with Nose, but the documentation suggests that you could write your own ErrorClass plugin that will take a screenshot when the error/failure occurs.
1
The above doesn't look like what you intend to do, you are sending an ENTER keystroke to the logout element, waiting for 0.5 seconds (no need to wrap that in a try / catch as the sleep should not fail to execute), then you are moving the mouse to the element and then trying to click it.
Only one of the above should be necessary if this is a normal button or ...
1
If the Java applet is written to be accessible then you can use UIAutomaion (replacement for MSAA since Windows Vista) to automate it. Even if it is not 100% accessible, you may still be able to use UIAutomation. QTP likely uses MSAA or UIAutomation under the hood to drive it's non-web automation. There are a number of other solutions win32 automation ...
1
Well, this is more of a workaround than a true fix or answer -- and I'll award the bounty to any better solution -- but here's what I ended up doing. It checks to make sure it typed what I wanted it to type, and retries if not.
def do_find(self, term):
""" interacts with the search form """
for _ in xrange(5):
textbox = ...
1
Is a page URL a property of the Page Object ? What if a number of different URLs lead to the same page ? Also, what if the URL is used to pass some parameters, do you if at all deal with that ?
Most of my pages don't know (or care) about the URLs that lead to them. When I have pages that I want to jump to directly (rather than navigating to by ...
1
If you have very simple tests to run, take a look at our free version - Load Tester LITE. It is currently limited to pretty simple tests, but is free if you supply the load-generating hardware and allows unlimited VUs.
Only top voted, non community-wiki answers of a minimum length are eligible
