Search Results

Search found 452 results on 19 pages for 'selenium webdriver'.

Page 3/19 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Connection Refused running multiple environments on Selenium Grid 1.04 via Ubuntu 9.04

    - by ReadyWater
    Hello, I'm writing a selenium grid test suite which is going to be run on a series of different machines. I wrote most of it on my macbook but have recently transfered it over to my work machine, which is running ubuntu 9.04. That's actually my first experience with a linux machine, so I may be missing something very simple (I have disabled the firewall though). I haven't been able to get the multienvironment thing working at all, and I've been trying and manual reviewing for a while. Any recommendations and help would be greatly, greatly appreciated! The error I'm getting when I run the test is: [java] FAILED CONFIGURATION: @BeforeMethod startFirstEnvironment("localhost", 4444, "*safari", "http://remoteURL:8080/tutor") [java] java.lang.RuntimeException: Could not start Selenium session: ERROR: Connection refused I thought it might be the mac refusing the connection, but using wireshark I determined that no connection attempt was made on the mac . Here's the code for setting up the session, which is where it seems to be dying @BeforeMethod(groups = {"default", "example"}, alwaysRun = true) @Parameters({"seleniumHost", "seleniumPort", "firstEnvironment", "webSite"}) protected void startFirstEnvironment(String seleniumHost, int seleniumPort, String firstEnvironment, String webSite) throws Exception { try{ startSeleniumSession(seleniumHost, seleniumPort, firstEnvironment, webSite); session().setTimeout(TIMEOUT); } finally { closeSeleniumSession(); } } @BeforeMethod(groups = {"default", "example"}, alwaysRun = true) @Parameters({"seleniumHost", "seleniumPort", "secondEnvironment", "webSite"}) protected void startSecondEnvironment(String seleniumHost, int seleniumPort, String secondEnvironment, String webSite) throws Exception { try{ startSeleniumSession(seleniumHost, seleniumPort, secondEnvironment, webSite); session().setTimeout(TIMEOUT); } finally { closeSeleniumSession(); } } and the accompanying build script used to run the test <target name="runMulti" depends="compile" description="Run Selenium tests in parallel (20 threads)"> <echo>${seleniumHost}</echo> <java classpathref="runtime.classpath" classname="org.testng.TestNG" failonerror="true"> <sysproperty key="java.security.policy" file="${rootdir}/lib/testng.policy"/> <sysproperty key="webSite" value="${webSite}" /> <sysproperty key="seleniumHost" value="${seleniumHost}" /> <sysproperty key="seleniumPort" value="${seleniumPort}" /> <sysproperty key="firstEnvironment" value="${firstEnvironment}" /> <sysproperty key="secondEnvironment" value="${secondEnvironment}" /> <arg value="-d" /> <arg value="${basedir}/target/reports" /> <arg value="-suitename" /> <arg value="Selenium Grid Java Sample Test Suite" /> <arg value="-parallel"/> <arg value="methods"/> <arg value="-threadcount"/> <arg value="15"/> <arg value="testng.xml"/> </java>

    Read the article

  • Selenium IDE and Drupal

    Can I use Selenium IDE on a Drupal system? I found http://drupal.org/project/selenium but that involves downloading Core and not using my current machine. Does anybody know of a way to use the IDE with Drupal, or if not what do you suggest I do?

    Read the article

  • Using Selenium-IDE with a rich Javascript application?

    - by Darien
    Problem At my workplace, we're trying to find the best way to create automated-tests for an almost wholly javascript-driven intranet application. Right now we're stuck trying to find a good tradeoff between: Application code in reusable and nest-able GUI components. Tests which are easily created by the testing team Tests which can be recorded once and then automated Tests which do not break after small cosmetic changes to the site XPath expressions (or other possible expressions, like jQuery selectors) naively generated from Selenium-IDE are often non-repeatable and very fragile. Conversely, having the JS code generate special unique ID values for every important DOM-element on the page... well, that is its own headache, complicated by re-usable GUI components and IDs needing to be consistent when the test is re-run. What successes have other people had with this kind of thing? How do you do automated application-level testing of a rich JS interface? Limitations We are using JavascriptMVC 2.0, hopefully 3.0 soon so that we can upgrade to jQuery 1.4.x. The test-making folks are mostly trained to use Selenium IDE to directly record things. The test leads would prefer a page-unique HTML ID on each clickable element on the page... Training the testers to write or alter special expressions (such as telling them which HTML class-names are important branching points) is a no-go. We try to make re-usable javascript components, but this means very few GUI components can treat themselves (or what they contain) as unique. Some of our components already use HTML ID values in their operation. I'd like to avoid doing this anyway, but it complicates the idea of ID-based testing. It may be possible to add custom facilities (like a locator-builder or new locator method) to the Selenium-IDE installation testers use. Almost everything that goes on occurs within a single "page load" from a conventional browser perspective, even when items are saved Current thoughts I'm considering a system where a custom locator-builder (javascript code) for Selenium-IDE will talk with our application code as the tester is recording. In this way, our application becomes partially responsible for generating a mostly-flexible expression (XPath or jQuery) for any given DOM element. While this can avoid requiring more training for testers, I worry it may be over-thinking things.

    Read the article

  • Sending multiple requests simultaneously to the Server using Selenium with Java

    - by gagneet
    I wish to send multiple requests to the server, simultaneously. The problem statement will be: Read a text file containing multiple URL’s. Open each URL in the web browser. Collect the Cookie information for each call, and store it to a file. Send another call: http://myserver.com:1111/cookie?out=text Store the output (body text) of this file to a separate file for each call made in 4 Open the next URL in the text file given in 1 and repeat steps 1-6. The above is to be run with multi-threading, so that I can send around 5-10 URL requests simultaneously. I have implemented something in Selenium using Java, but have not been able to do the multi-threading approach. Code is given below: package com.cookie.selenium; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import com.thoughtworks.selenium.*; public class ReadURL extends SeleneseTestCase { public void setUp() throws Exception { setUp("http://www.myserver.com/", "*chrome"); } public static void main(String args[]) { Selenium selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://myserver"); selenium.start(); selenium.setTimeout("30000000"); try { BufferedReader inputfile = new BufferedReader(new FileReader("C:\\url.txt")); BufferedReader cookietextfile = new BufferedReader(new FileReader("C:\\text.txt")); BufferedWriter cookiefile = new BufferedWriter(new FileWriter("C:\\cookie.txt")); BufferedWriter outputfile = null; String str; String cookiestr = "http://myserver.com:1111/cookie?out=text"; String filename = null; int i = 0; while ((str = inputfile.readLine()) != null) { selenium.createCookie("T=222redHyt345&f=5&r=fg&t=100",""); selenium.open( str ); selenium.waitForPageToLoad("120000"); String urlcookie = selenium.getCookie(); System.out.println( "URL :" + str ); System.out.println( "Cookie :" + urlcookie ); cookiefile.write( urlcookie ); cookiefile.newLine(); selenium.open( cookiestr ); selenium.waitForPageToLoad("120000"); String bodytext = selenium.getBodyText(); System.out.println("Body Text :" + bodytext); filename = "C:\\cookies\\" + i + ".txt"; outputfile = new BufferedWriter(new FileWriter( filename )); outputfile.write( bodytext ); outputfile.newLine(); i++; } inputfile.close(); outputfile.close(); cookiefile.close(); selenium.stop(); } catch (IOException e) { } } } What basically I am trying to do here is, open the first set of URL from a text file (which has list given of all the URL's i wish to open). Then when I capture the cookie information from here and store it, I open another window to output all the cookie information for that server to my browser window. This works fine when I do outside of Selenium code, but when I do it within the above code, it opens a "Save As..." popup and my tests stop. :-( I wish to save the contents of that second call to a new file, but have not been able to do the same. Also, if I have to send multiple such requests to the server, how would that be possible in Java using a Selenium Framework. Currently, I am opening multiple instances of the framework and running them with different parameters :-(

    Read the article

  • not able to select hidden link - selenium

    - by Maddy
    I have to select web link when i mouse hover to particular frame in the webpage, the button(link to next page) will be visible. WebElement mainElement = driver.findElement(By.xpath(<frame xpath >)); Actions builder = new Actions(driver); builder.moveToElement(mainElement); WebElement button1 = driver.findElement(By.xpath("//*[@id='currentSkills']/div[1]/div/a")); builder.moveToElement(button1).click().perform(); I am still unable to select the particular link when i execute, the following error am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 131 milliseconds But when i hover mouse pointer to the particular frame during AUT(just to move to particular frame without clicking anything), then test is executing sucessfully. I know this can be handled by JS. But i want to find out is there any solution within selenium webdriver Your help is much appreciated... Thanks Madan

    Read the article

  • Issue selenium code maintenance

    - by Rajasankar
    I want to group the common methods in one file and use it. For example, login to a page using selenium may be used in multiple times. Define that in class A and call it in class B. However, it throws null pointer exception. class A has public void test_Login() throws Exception { try{ selenium.setTimeout("60000"); selenium.open("http://localhost"); selenium.windowFocus(); selenium.windowMaximize(); selenium.windowFocus(); selenium.type("userName", "admin"); selenium.type("password", "admin"); Result=selenium.isElementPresent("//input[@type='image']"); selenium.click("//input[@type='image']"); selenium.waitForPageToLoad(Timeout); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all other java syntax in class B public void test_kk() throws Exception { try { a.test_Login(); } catch(Exception ex) { System.out.println(ex); ex.printStackTrace(); } } with all syntax. When I execute class B, I got this error, java.lang.NullPointerException at A.test_Login(A.java:32) at B.test_kk(savefile.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.j ava:212) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.doRun(TestRunner.java:109) at junit.textui.TestRunner.run(TestRunner.java:77) at B.main(B.java:77) I hope someone must have tried this before. I may miss something here.

    Read the article

  • Open a URL with parameters using selenium.open()

    - by gagneet
    I am using selenium.open(), to open a URL, which prints the cookie output to the browser window: String cookiestr = "http://my.server.com/cookie?out=text"; selenium.open( cookiestr ); The problem is that, it opens a "Save As..." popup, to save the file named "cookie". When I open the same URL in my browser directly, it displays text in the browser window. I want to capture the body text shown, when I open the URL, but am unable to do so. Is there any other command available which I can use to do this? BufferedWriter outputfile = null; String bodytext = selenium.getBodyText(); System.out.println("Body Text :" + bodytext); Integer I = new Integer(i); filename = "C:\\cookies\\" + I.toString() + ".txt"; outputfile = new BufferedWriter(new FileWriter( filename )); outputfile.write( bodytext ); outputfile.newLine(); i++;

    Read the article

  • Selenium navigation inside foreach loop

    - by smudgedlens
    I am having an issue with navigation. I get a list of rows from an html table. I iterate over the rows and scrape information from them. But there is also a link on the row that I click to go to more information related to the row to scrape. Then I navigate back to the page with the original table. This works for the first row, but for the subsequent rows, it throws an exception. I look at my row collection after the first time the link inside a row is clicked, and none of them have the correct values like they did before I clicked the link. I believe that there is something going on when I navigate to a different URL that I'm not getting. My code is below. How do I get this working so I can iterate over the parent table, click the links in each row, navigate to the child table, but still continue iterating over the rows in the parent table? private List<Document> getResults() { var documents = new List<Document>(); //Results IWebElement docsTable = this.webDriver.FindElements(By.TagName("table")) .Where(table => table.Text.Contains("Document List")) .FirstOrDefault(); var validDocRowRegex = new Regex(@"^(\d{3}\s+)"); var docRows = docsTable.FindElements(By.TagName("tr")) .Where(row => //It throws an exception with .FindElement() when there isn't one. row.FindElements(By.TagName("td")).FirstOrDefault() != null && //Yeah, I don't get this one either. I negate the match and so it works?? !validDocRowRegex.IsMatch( row.FindElement(By.TagName("td")).Text)) .ToList(); foreach (var docRow in docRows) { //Todo: find out why this is crashing on some documents. var cells = docRow.FindElements(By.TagName("td")); var document = new Document { DocID = Convert.ToInt32(cells.First().Text), PNum = Convert.ToInt32(cells[1].Text), AuthNum = Convert.ToInt32(cells[2].Text) }; //Go to history for the current document. cells.Where(cell => cell.FindElements(By.TagName("a")).FirstOrDefault() != null) .FirstOrDefault().Click(); //Todo: scrape child table. this.webDriver.Navigate().Back(); } return documents; }

    Read the article

  • Webdriver PageObject Implementation using PageFactory in Java

    - by kamal
    here is what i have so far: A working Webdriver based Java class, which logs-in to the application and goes to a Home page: import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.testng.AssertJUnit; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class MLoginFFTest { private WebDriver driver; private String baseUrl; private String fileName = "screenshot.png"; @BeforeMethod public void setUp() throws Exception { FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.http.phishy-userpass-length", 255); profile.setAssumeUntrustedCertificateIssuer(false); driver = new FirefoxDriver(profile); baseUrl = "https://a.b.c.d/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testAccountLogin() throws Exception { driver.get(baseUrl + "web/certLogon.jsp"); driver.findElement(By.name("logonName")).clear(); AssertJUnit.assertEquals(driver.findElement(By.name("logonName")) .getTagName(), "input"); AssertJUnit.assertEquals(driver.getTitle(), "DA Logon"); driver.findElement(By.name("logonName")).sendKeys("username"); driver.findElement(By.name("password")).clear(); driver.findElement(By.name("password")).sendKeys("password"); driver.findElement(By.name("submit")).click(); driver.findElement(By.linkText("Account")).click(); AssertJUnit.assertEquals(driver.getTitle(), "View Account"); } @AfterMethod public void tearDown() throws Exception { File screenshot = ((TakesScreenshot) driver) .getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(screenshot, new File(fileName)); } catch (IOException e) { e.printStackTrace(); } driver.quit(); } } Now as we see there are 2 pages: 1. Login page, where i have to enter username and password, and homepage, where i would be taken, once the authentication succeeds. Now i want to implement this as PageObjects using Pagefactory: so i have : package com.example.pageobjects; import static com.example.setup.SeleniumDriver.getDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.FluentWait; import org.openqa.selenium.support.ui.Wait; public abstract class MPage<T> { private static final String BASE_URL = "https://a.b.c.d/"; private static final int LOAD_TIMEOUT = 30; private static final int REFRESH_RATE = 2; public T openPage(Class<T> clazz) { T page = PageFactory.initElements(getDriver(), clazz); getDriver().get(BASE_URL + getPageUrl()); ExpectedCondition pageLoadCondition = ((MPage) page).getPageLoadCondition(); waitForPageToLoad(pageLoadCondition); return page; } private void waitForPageToLoad(ExpectedCondition pageLoadCondition) { Wait wait = new FluentWait(getDriver()) .withTimeout(LOAD_TIMEOUT, TimeUnit.SECONDS) .pollingEvery(REFRESH_RATE, TimeUnit.SECONDS); wait.until(pageLoadCondition); } /** * Provides condition when page can be considered as fully loaded. * * @return */ protected abstract ExpectedCondition getPageLoadCondition(); /** * Provides page relative URL/ * * @return */ public abstract String getPageUrl(); } And for login Page not sure how i would implement that, as well as the Test, which would call these pages.

    Read the article

  • Selenium and HTTPS/SSL

    - by NerdyNick
    I'm running selenium-rc 1.0.3 on a Mac OS X & Windows 7 and both seem to be giving my the annoying accept cert error in firefox. In reading the docs they say I should be able to just use the *firefox run mode and rc should take care of it for me via a proxy or something, but this appears to not work. The only solution that I was able to find on the internet was to create a skeleton profile and pass the path into the rc startup, but thats not a real option. As that doesn't solve problems of testing in IE/Chrome/Safari. Does any know of any other solution that will work. Selenium-RC docs on HTTPS - http://seleniumhq.org/docs/05_selenium_rc.html#handling-https-and-security-popups

    Read the article

  • Native Mouse events with Flash and Selenium

    - by Dan at Demand
    I understand that Selenium does not support Flash, but it is my understanding that I should be able to do some simplistic testing of Flash by using Selenium's built in native mouse support and doing mouse up/down events based on coordinates. Is this correct? I can't seem to get it working. I'm trying to test on this page: http://mandy-mania.blogspot.com/2010/04/sneak-peek-of-final-season-of-lost-dvd.html and all I'm trying to do is click on the flash object so it plays the video. I've tried all sorts of commands, MouseOver, MouseDown, MouseDownAt, MouseUp, MouseUpAt, etc. So, I'm wondering if this just theoretically doesn't work or if I'm just doing something wrong. The xpath I'm using is //object[@id='player'], although I've tried a number of different combinations. And yes, I've also tried just the straight click command. Any suggestions? Thanks!

    Read the article

  • Distributing requests to Selenium Grid RC's?

    - by intervigil
    I've got a situation here where I have a central selenium grid hub, and several RC's running on my gogrid account. When I access it to run tests, it basically queues all the incoming test requests and executes them serially on only one of the RC's, instead of spreading them out to use available RC's. The tests come from multiple projects, so I'm not looking to parallelize the tests themselves, just to split the requests that come from multiple projects across the multiple RC's. From everything I've read, it seems like selenium grid should be doing this already, yet I only see one RC used to run every single test. Is there something I'm missing?

    Read the article

  • how does selenium webdriver upload files to the browser?

    - by justspamjustin
    I am a javascript/java developer and I have been trying to figure out how the selenium webdriver automation framework uploads files from the file system. It is impossible to set a file input via javascript because it is a security violation. Yet somehow webdriver is able to do this with the following command: driver.setFileDetector(new LocalFileDetector()); WebElement upload = driver.findElement(By.id("myfile")); upload.sendKeys("/Users/sso/the/local/path/to/darkbulb.jpg"); driver.findElement(By.id("submit")).click(); So they are setting the value by sending keys to it? I don't get it. I have looked through the source code found here: http://code.google.com/p/selenium/source/checkout I am still not able to find where they do this. Edit: My question is not how to do this with selenium, but how did the selenium developers make this possible? How did they get around the security restrictions in javascript? How are they uploading the file?

    Read the article

  • Only run selenium test if previous selenium test fails

    - by Mike Grace
    I have several 'it' blocks in my selenium test file (using Ruby and rspec) that test various portions of my web application. Each 'it' block stops executing and goes to the next 'it' block if any of the conditions or code fails. Is there a way to run an 'it' block only if the previous fails or call a function to react to the failed test? Is there a better way to accomplish what I am wanting to do that doesn't involve an 'it' block? Example 'it' block it "should load example.com" do page.open("http://example.com") page.wait_for_page_to_load(25) end

    Read the article

  • Selenium Test Results are empty

    - by simonC
    I've Jenkins and selenium configured to run tests after the app is build, everything is ok till the moment that selenium tests should run, actually the selenium test suite starts correctly and then it stops after the first test and does not go forward. I'm using VNC to watch what is happening. The logs produces by selenium are empty. Im testing those test via java -jar /var/lib/selenium/selenium-server-jar -browserSessionReuse -htmlSuite *firefox https://test-a.4pm.si /var/lib/jenkins/jobs/4pm_test/workspace/4pm_ee-test/selenium_tests/suite.html /var/lib/jenkins/jobs/4pm_test/workspace/selenium-result.html the selenium-result.html is empty it just execute the first test which is OK and stops there is there any selenium server setting I need to set?

    Read the article

  • "SessionId doesn't exist" error when starting Selenium server

    - by ripper234
    I'm raising a Selnium-server (the jar), and getting this exception without trying to talk to the server. What can be the cause? The errors keep coming in once every 2 seconds. Could this be some leftover from a previous Selenium run? C:\Foo>java -jar ..\..\..\..\lib\Selenium\selenium-server.jar 14:53:30.141 INFO - Java: Sun Microsystems Inc. 14.2-b01 14:53:30.142 INFO - OS: Windows Server 2008 6.1 amd64 14:53:30.149 INFO - v1.0.1 [2696], with Core v@VERSION@ [@REVISION@] 14:53:30.209 INFO - Version Jetty/5.1.x 14:53:30.210 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 14:53:30.211 INFO - Started HttpContext[/selenium-server,/selenium-server] 14:53:30.211 INFO - Started HttpContext[/,/] 14:53:30.217 INFO - Started SocketListener on 0.0.0.0:4444 14:53:30.218 INFO - Started org.mortbay.jetty.Server@2747ee05 14:53:31.729 INFO - Checking Resource aliases 14:53:31.735 WARN - POST /selenium-server/driver/?seleniumStart=true&localFrameAddress=top&seleniumWindowName= &uniqueId=sel_27224&sessionId=1f2385b8bae24f6fb79816753de7cd69&counterToMakeURsUniqueAndSoStopPageCachingInThe Browser=1255006411692&sequenceNumber=268 HTTP/1.1 java.lang.RuntimeException: sessionId 1f2385b8bae24f6fb79816753de7cd69 doesn't exist; perhaps this session was already stopped? at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:218 ) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserResponse(SeleniumDriverResour ceHandler.java:159) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java: 127) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

    Read the article

  • Skip CodedUI Tests, use Selenium for Web Automation

    - by Aligned
    Originally posted on: http://geekswithblogs.net/Aligned/archive/2013/10/31/skip-codedui-tests-use-selenium-for-web-automation.aspxI recently joined a team that was using Agile Methodologies to create a new product. They have a working beta product after 10 or so 2 week sprints and already had UI’s that had changed several times as they went through iterations of their UI. As a result, the QA team was falling behind with automated tests and I was tasked to help them catch up and expand their tests. The project is a website. I heard many complaints about how hard it is to work with CodedUI (writing our own code, not relying on the recorder as we wanted re-usable and more maintainable code) then it took me 4+ hours to fix one issue. It was hard to traverse the key and debugging the objects with breakpoints… I said out loud “there has to be a better way or a framework the uses jQuery to run through the tests.” Plus it seemed really slow (wait… finding the object … wait… start putting in text…). Plus some tests would randomly fail on the test agents (using the test settings and an automated build, they are run on VMs using Microsoft test agents). Enough complaining. Selenium to the rescue (mostly). The lead QA guy decided to try it out and we haven’t turned back. We are now running tests in Chrome and Firefox and they run a lot faster. We had IE running to, but some of the tests were running fine locally, but hanging on the test agents. I’ll add some hints and lessons learned in a later post.

    Read the article

  • Should selenium tests be written in imperative style?

    - by Amogh Talpallikar
    Is an automation tester supposed to know concepts of OOPS and design patterns to write Tests in a way where changes & code re-use are possible? For example, I pick up Java to write cucumber step definitions that instruct a selenium webdriver. Should I be using a lot of inheritance, interfaces, delegation etc. to make life easier or would that be overly complicated for something that should just line by line instructions?

    Read the article

  • Take screenshot with Selenium: WaitForPageToLoad does not wait long enough

    - by OregonGhost
    I'm trying to get screenshots from a web page with multiple browsers. Just experimenting with Selenium RC, I wrote code like this: var sel = new DefaultSelenium(server, 4444, target, url); sel.Start(); sel.Open(url); sel.WaitForPageToLoad("30000"); var imageString = sel.CaptureScreenshotToString(); This basically works, but in most cases the screenshot is of a blank browser window, because the page is not yet ready for display. It kind of works if I add a sleep just after the WaitForPageToLoad, but that slows down the fast browsers and/or may be to short for the slower browsers (or under load). A typical solution for this seems to be to wait for the presence of a certain element. However, this is meant as a simple generic solution to get a screenshot of a local web page with as many browsers as possible (to test the layout) and I don't want to have to enter certain element names or whatever. It's a simple tool where you just enter the Selenium Server URL and the URL you want to test, and get the screenshots back. Any advice?

    Read the article

  • Getting hover text with selenium in java

    - by BinaryEmpire
    I am trying to figure out how to get the product availability text from a page like http://www.walmart.com/browse/TV-Video/TVs/_/N-96v3? (once a store has been selected) I selected 76574 as my zipcode and went to the "In My Store" tab The code I have now is WebElement hoverElement = driver.findElement(By.xpath(".//*[@id='Body_15992428']/span")); WebElement hidden = driver.findElement(By.xpath(".//*[@id='slapInfo_NoVariant_15992428']/div")); Actions builder = new Actions(driver); builder.clickAndHold(hoverElement).build().perform(); System.out.println(hidden.getText()); **Edit: I tried profile.setEnableNativeEvents(false); and the text is now displayed in the automated browser window. I still cannot get to the text I want though. It does not throw an exception, only displays nothing because the driver thinks its still hidden. Any one know how to fix this? I keep getting Exception in thread "main" org.openqa.selenium.InvalidElementStateException: Cannot perform native interaction: Could not load native events component. Even after I do profile.setEnableNativeEvents(true); Are there any other ways I can get the hidden text, or what am I doing wrong here? Additionally while I was inspecting the code with firebug, I saw that there is this code <script type="text/javascript"> WALMART.$(document).ready(function(){ WALMART.$('#Body_15992428').hover(function(){ WALMART.$('#SeeStoreAvailBubble').wmBubble('update',WALMART.$('#bubbleMsgUpdate_15992428').html()); }); }); </script> I dont really know how to do things directly with javascript but is there is any way of getting the message text directly from that with a javascript executor?

    Read the article

  • Capture output from browser call using Selenium

    - by gagneet
    I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file. What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser.

    Read the article

  • Selenium IDE and telling it to record actions

    - by sprog
    I am trying to make a little application to allow to record actions within a Flash and Silverlight application. In such manner that you can compile your interactive application in test-mode and then be able to click on elements which then passed the action to Selenium IDE which then adds this command to the testcase. I am curious if this even possible and how I can achieve this in Firefox?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >