Tag Info

Hot answers tagged

6

Selenium is a tool that remote-controls a browser. You can use it to simulate a user interacting with a web site. JUnit is a framework for writing Java unit tests. It takes some of the grunt work out of organizing tests and generating reports. You can express each test as a method on a class; typically, you have multiple tests per class. JUnit will run ...


6

Java My experience is, that the basics of Java suffice to start developing test cases with Selenium 2 / WebDriver. Myself started developing of Selenium test cases with a basic knowledge about Java. The more test cases I wrote and solutions I had to find, the more I leaned about the programming language. Unit Testing Framework (JUnit, TestNG) Write some ...


4

Not everyone on the team needs the same skills, and if you already have enough development capacity you might be more valuable for the overall results if you take up other tasks. When working together with testers in an automation project, developers can focus on the development part if there is someone else who: Really understands the application and the ...


4

Try this line of code: Driver.findElement(By.xpath("enter your xpath")).click(); Hope it works out!


4

You can use the following code also to handle popup. String mainwindow = driver.getWindowHandle(); for (String popup : driver.getWindowHandles()){ driver.switchTo().window(popup); } // Your code on poppup window driver.switchTo().window(mainwindow); //Switching to main/parent window Hope this will help :)


4

For testing it, your doing an extremely basic test. A major advantage of automation is that you can do a lot more testing. I would set up a datasource for names, declare them valid or invalid, and have it attempt to use it. I would also have it only use one of the special characters at a time and the rest be valid (As of now your essentially testing if any ...


4

If your using Java, here is the JavaDoc If your using Ruby, here is the Ruby Docs If your using Python, here is the Python Docs If your using .Net, here is the .Net docs This will contain all of the functions that Selenium uses.


4

You can use the findElements method to find all TD tags that match your criteria, and then getText method to retrieve each element's value. The latter will be returned as a String, so you may need to convert it to a number before comparing it. Since the sorted elements have a special class, you may want to use a CSS selector with findElements.


4

You mean to say in one class multiple methods you want to run, then use below code and try. @BeforeTest public static void beforeMethod() { driver= new FirefoxDriver(); } @Test public void main1() { driver.get("http://indianrail.gov.in/pnr_Enq.html"); driver.findElement(By.id("element")).sendKeys("1234567890"); String ...


4

Although i do not have much idea about it but i think you can give selenium grid a try. I read on seleniumhq.org that with selenium grid you can create a master slave architecture, where one master machine will control several slaves to send request to a common server. Maybe this can help solve your issue!


3

No, Selenium 2 / WebDriver is for web applications only. But there are other tools to automate desktop application GUI tests. http://en.wikipedia.org/wiki/List_of_GUI_testing_tools You can also search for "desktop application" on this site to find recommended tools.


3

Try this Driver.SwitchTo().frame("Fancybox-frame"); Driver.findElement("enter your xpath to close popup").click(); Driver.SwitchTo().defaultContent();


3

I don't see why this couldn't be done if you have a code driven Selenium test suite. You would need to implement a method run on test failure that adds a bug to Bugzilla using their HTTP REST API. For the first step, if you are using Java, see this answer on taking a screenshot when selenium fails and the referenced blog post. You need to similarily ...


3

Well the reason you are getting so many different matched is because you print it as you go through the loop. My personal suggestion, I like the KISS method, change the code to something like the following: public class Ex1 { private WebDriver d; @Test public void testUntitled() throws Exception { d = new FirefoxDriver(); ...


3

Depending on your project you may also assert visual consistency, for example in a website that shows breadcrumbs the level of nesting should be consistent with the displayed breadcrumbs. Maybe a 'minimum width' for buttons/text inputs/etc. You may also probe performance and measure how fast is the site loading. Whether these are expected of you or not is ...


3

I understand you have problems with test automation because you are not much skilled (yet) in programming. And it hurts. I believe the more something hurts, the more resistance something offers, the more you need to practice that until the moment things become a routine for you and you become more effective. There are no workarounds and shortcuts to master ...


3

type void type(java.lang.String locator, java.lang.String value) Sets the value of an input field, as though you typed it in. Inputs the value. Sets the textfield to the value, nothing special. It just takes the entire string and puts it in there at one time. typeKeys void typeKeys(java.lang.String locator, java.lang.String value) ...


3

The actual slider is a link-element you should be able to define a css selector based on its classes. <a class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a> The first you find is the left slider, the second the right slider. I have successfully used use the Action Builder and the MoveToOffsetAction to drag a slider X number ...


2

If you can't determine why the browser won't launch, you can make your tests more robust. Make sure to clean the environment during test warmup, add some retry/wait/timeout wrappers around the section that launches the browser, and kill any processes and services that aren't relevant to the test. In order to find out why the browser is crashing, you can ...


2

To close popup - first you need to check which one is the active window in your application (Popup or main window). If popup is active then you can use " driver.close();" OR if the main window is active (Focused), then you need to use window handler to close this popup.


2

Try using SIkuli it can automate anything , since it uses Image recognition http://www.sikuli.org/


2

If this is a Javascript alert box, this is relatively straightforward; you can switch to it with driver.switchTo().alert(); in Java. If you save the return value of that as an Alert object, you can interact with it, like alert.accept(). See the javadoc for more information. Since you're asking, however, I suspect it's not so simple. If this is not really an ...


2

Both Saucelabs and TestingBot provide a service which records your Selenium tests if you run them against their Selenium Grid. Both offer a number of free minutes per month, which might suffice your needs. You can view/download the video's straight after the test run is finished. Although I don't know how their setup works, I think I can give you some ...


2

I've found in the past that using a BDD framework like SpecFlow helped me with this. You can start off writing the tests, and slowly start writing the code for it each of the tests as your able to. SpecFlow is great for code re-use, although, it can take some getting used to. An example of this is every time you use "And log in to the application", the ...


2

Your nice list covers all of the usual bases. Another possibility: Implement some sort of "critical region" mechanism around the individual pieces of data that are shared among tests, and that different tests require to have different values. This creates its own problems, of course. It causes one test to block while waiting for another to finish with ...


2

You can try setting implicit wait time. (Documentation) // 5 seconds implicit wait (C# code) IWebDriver driver = new FirefoxDriver(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));


2

This is how I would debug a Selenium session to find out what is happening: Step-by-step debugging: Most IDE's allow you todo step-by-step debugging, you could set a break point just before the point you want to investigate. This will pause the execution of the test and lets you examine the browser with its own tools. You can step thru each line of code one ...


2

Selenium has no built in support to execute a test case, or collection of test cases, or ability to execute a parameterized test case. Selenium is simply a framework to interact with a web UI. The test execution engine you use to actually kick off your selenium tests varies depending on which language you are using, and even for a specific language there ...


2

The tools you name are used during different steps in the SDLC, they can be replaced by other alternative tools Example (partial) development life cycle: Programming -> Check-in to version control -> Schedule build and run build -> Run automated test against build -> Report failing tests/builds Check-in to version control After developers are ...


2

It is quite easy to hide the browser without XVFB. Just install PhantomJS. Then, change this line: driver = webdriver.Firefox() to: driver = webdriver.PhantomJS() The rest of your code won't need to be changed and no browser will open. For debugging purposes, use driver.save_screenshot('screen.png') at different steps of your code.



Only top voted, non community-wiki answers of a minimum length are eligible