Tag Info

New answers tagged

0

Here is the method I use to take screenshots using webdriver: private void takeScreenShot(EPropertiesNames path, Integer... screenID) { File directory = createFolder(path); try { // Toma la captura de imagen File imagen = ((TakesScreenshot) accesoWeb.getDriver()).getScreenshotAs(OutputType.FILE); StringBuilder sb = new ...


0

The Selenium Grid and Node is downward compatible. It works with Selenium 1 and Selenium 2 / WebDriver. The seleniumProtocol parameters define for what version of Selenium the configuration apply. Selenium = Selenium 1 WebDriver = Selenium 2 / WebDriver


0

This is a sample of working code - selecting sex by male and female radio buttons. /* load that webelement list of radio buttons. then follow the below code & logic List<WebElement> rdBtn_Sex = driver.findElements(By.name("sex")); // Create a boolean variable which will hold the value (True/False) boolean bValue = false; ...


0

I suggest you simply driver.get(URL) to your homepage. Not sure why you consider a hack, if that is what you need to recover from test failure.


1

Something like this should work: public boolean isTextOnPagePresent(String text) { WebElement body = driver.findElement(By.tagName("body")); String bodyText = body.getText(); return bodyText.contains(text); } Currently I have no possibility to test that. If it should not work, you could try to use getPageSource() instead of get the text of the ...


0

Here is how it works in Ruby:' # test.rb require 'selenium-webdriver" @browser = Selenium::WebDriver.for :chrome @browser.navigate.to "http://www.google.com" dir_to_jquery = Dir.pwd + '/features/support/ajax_resources' # jQuerify.js is the same java script posted above by Joe Coder jquerystring = ...


1

If I understand correctly, you are looking at ways to make your tests more efficient, so you can get as quickly as possible to the desired state and then perform the actual assertion that the test case is intended to cover. There are a couple of options you have: Use a class setup method, or application setup method to log in, then re-use your existing, ...


0

PageObject design pattern Every test needs to log in, but code is in one place, and any test will just use it, just 1 line of code. Login is not a problem. Other stuff, to prepare application's data to certain state might be bigger waste of time (but again, can be wrapped as single pageobject call). If you log just once, then run long trail of tests, they ...


2

I have seen this sort of thing before and the problem ended up being in how the page was coded: onmouseover vs onchange in our case. You may want to look at the the javascript events for the page, as it sounds very possible that the human interaction is causing some method to run whereas the web driver is changing objects in the DOM, and allowing web driver ...


0

Instead of simple System.out.println (last line in your example) try out the following: PrintStream out = new PrintStream(System.out, true, "UTF-8"); out.println("Currency Selected:" +select.getText());


0

Thanks for your responses finally I solved it cutting out some plugins and blocked some third party ads before starting the tests. Solution 1: There are some plugins like flash player which may hangs the browser inconsistently waiting for some resource during test run, try disabling such plugins while starting the test using the chrome switches. ...



Top 50 recent answers are included