selenium-rc

Difference between Selenium RC and WebDriver

南楼画角 提交于 2019-11-27 17:31:33
What's the basic difference between Selenium RC and WebDriver ? Ripon Al Wasim Quoting from WebDriver and Selenium RC : Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. How these direct calls are made, and the features they support depends on the browser you are using. Information on each ‘browser driver’ is provided later in this chapter. For those familiar with Selenium-RC, this is quite different from what you are used to. Selenium-RC worked the same way for each supported browser. It ‘injected’ javascript functions into the browser

How can I count the number of elements that match my CSS selector?

别等时光非礼了梦想. 提交于 2019-11-27 17:26:46
问题 I am trying to use SeleniumRC to test my GWT App and am trying to match elements using CSS selectors. I want to count the number of enabled buttons in the following HTML. A button is enabled if it is under a <td> with class="x-panel-btn-td " and disabled if it is under a <td> with class="x-panel-btn-td x-hide-offsets" . So basically, I want to retrieve the number of buttons under all <td> s with the class x-panel-btn-td . <table cellspacing="0"> <tbody> <tr> <td id="ext-gen3504" class="x

How to use regex in selenium locators

穿精又带淫゛_ 提交于 2019-11-27 14:58:31
问题 I'm using selenium RC and I would like, for example, to get all the links elements with attribute href that match: http://[^/]*\d+com I would like to use: sel.get_attribute( '//a[regx:match(@href, "http://[^/]*\d+.com")]/@name' ) which would return a list of the name attribute of all the links that match the regex. (or something like it) thanks 回答1: The answer above is probably the right way to find ALL of the links that match a regex, but I thought it'd also be helpful to answer the other

Checking HTTP Status Code in Selenium

南楼画角 提交于 2019-11-27 14:34:01
How to get the HTTP status code in Selenium? E.g. so I can test that if the browser requests /user/27 and no user with ID=27 exists, an HTTP 404 is returned? My primary interest is Selenium RC, but if someone knows the answer for "normal" selenium, I can probably easily translate it into RC. /Pete AutomatedTester This might not be the best use of Selenium for this type of test. There is unnecessary need to load a browser when you could do and have a faster running test [Test] [ExpectedException(typeof(WebException), UserMessage = "The remote server returned an error: (404) Not Found")] public

Flash automation using Selenium RC

两盒软妹~` 提交于 2019-11-27 14:19:47
问题 I'm struggling a lot to automate Flash using Selenium RC. Can any one please give me a sample Flash application code (methods) and the Selenium RC code to automate the same. 回答1: You might also want to take a look at FlashSelenium. They have a working example documented. That worked for me. 回答2: Selenium can not automate applications that work within their own blackbox in the browser. This means that Selenium can not test Silverlight and Flash. There is Flexmonkium which is a Selenium

Pass command line arguments to JUnit test case being run programmatically

筅森魡賤 提交于 2019-11-27 13:52:19
I am attempting to run a JUnit Test from a Java Class with: JUnitCore core = new JUnitCore(); core.addListener(new RunListener()); core.run(classToRun); Problem is my JUnit test requires a database connection that is currently hardcoded in the JUnit test itself. What I am looking for is a way to run the JUnit test programmatically(above) but pass a database connection to it that I create in my Java Class that runs the test, and not hardcoded within the JUnit class. Basically something like JUnitCore core = new JUnitCore(); core.addListener(new RunListener()); core.addParameters(java.sql

Clicking at coordinates without identifying element

安稳与你 提交于 2019-11-27 13:12:45
As part of my selenium test for a login function, I would like to click a button by identifying its coordinates, and instructing selenium to click at those coordinates. This would be done without actually identifying the element itself (via id, xpath, etc). I understand there are other more efficient ways to run a click command, but I'm looking to specifically use this approach to best match the user experience. Thanks. Selenium won't let you do this. There is a way to do this. Using the ActionChains API you can move the mouse over an element, adjust by some offset (relative to the middle of

How do I use the HTMLUnit driver with Selenium from Python?

纵然是瞬间 提交于 2019-11-27 12:27:31
问题 How do I tell Selenium to use HTMLUnit? I'm running selenium-server-standalone-2.0b1.jar as a Selenium server in the background, and the latest Python bindings installed with "pip install -U selenium". Everything works fine with Firefox. But I'd like to use HTMLUnit, as it is lighter weight and doesn't need X. This is my attempt to do so: >>> import selenium >>> s = selenium.selenium("localhost", 4444, "*htmlunit", "http://localhost/") >>> s.start() Traceback (most recent call last): File "

what's the relationship between Selenium RC and WebDriver?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 11:47:37
I can see that since selenium 2.0, WebDriver and Selenium RC are packaged together for download. Now I primarily use WebDriver, but can I bring in Selenium RC in my testing scripts from now and then? Is there anything that Selenium RC is capable of but WebDriver is not, or vice versa? pnewhook You should probably start your research here (though you may have already gone over this): http://seleniumhq.org/docs/03_webdriver.html I'll assume you're contrasting Selenium-RC to WebDriver, Selenium-IDE really isn't in the same ballpark. Selenium uses JavaScript to automate web pages. This lets it

Capturing JavaScript error in Selenium

三世轮回 提交于 2019-11-27 10:59:50
Is there a way to capture errors occurring in the DOM in Selenium and probably flag the same as an error in the page? To give a brief example, let's say I'm trying to bind an event on a non-existing HTML control, my browser throws an error saying: element abcd not found in the console. Now, if I want the same error to fail my selenium tests and the message that is shown on the browser is shown as the error message. Is it possible to do something like this? jhanifen Put this script on your page and then check in Selenium for the JSError: <script type="text/javascript"> window.onerror=function