Tag Info

Hot answers tagged

3

Yes, use soft assertions org.testng.asserts.SoftAssert. Soft assertions are assertions that do not terminate the test when they fail but results are included in the test execution report. More articles on that topic: http://stackoverflow.com/questions/19091526/how-soft-assertions-work ...


3

List cheeses = driver.findElements(By.className("cheese")); findElements() does not wait, but returns list of elements (located by locator). List is empty if nothing is found. http://docs.seleniumhq.org/docs/03_webdriver.jsp


3

You can click text. It just (usually) doesn't DO anything. Everything that exists CAN be clicked -- you can move your pointer over it and click the mouse. Whether the application does anything with that click event is up to the logic behind the page, which Selenium can't help you with because it doesn't know how your application works. An example with ...


2

Your password example is a classic example in favor of automation, once you have the infrastructure for entering a password and detecting rejection adding more cases should be simple and cost effective. You use the term Negative Testing to describe a type of scenario, but keep in mind that it is functional the same way as any other sunny day scenario, ...


2

It doesn't matter so much what you'll be automating, rather why. Are these negative tests included in your regression sets? Are these tests executed manually every time you run your automated scenarios? Will it eventually save the test team time and resources should it be automated? Seeing that testing frameworks can usually deal with expected errors, ...


2

Selenium 2 (webdriver) is designed to do exactly what you need. It allows you to simulate whatever real users can do with a browser: log to a website, click on buttons, fetch content of HTML elements, and analyze the text using any tools necessary. You can use different kinds of locators to identify HTML elements to process (ID, name, CSS class, link text ...


2

You can use Selenium Webdriver to automate this task. It can read the DOM of the HTML, and extract information from it; it controls a browser the same way you do, so anything you can do manually it can do (with a few exceptions). I would suggest looking into that rather than taking screenshots and parsing them as PDFs.


2

The answer was buried in some MSDN documentation that was challenging to google-reach: http://blogs.msdn.com/b/visualstudioalm/archive/2013/09/16/using-internet-explorer-11-and-not-able-to-record-a-web-performance-test-successfully.aspx Also ... don't forget to enable the test tool. Might have to check a couple places.


2

You can create extension methods for directly asserting elements. There you can wrap the assert statements with a try catch. In the catch, you can add the exception message to a log if you have one. public static class SafeAssertExtensions { public static void AreEquals(this IWebElement element, string expectedText) { try { ...


2

Your screenshot function is creating a new WebDriver instance each time and then taking a screenshot of the default blank page in firefox. You could try passing in your test's WebDriver instance so you get a picture from your test: static public void screenShotOnError(WebDriver driver) { long epoch = System.currentTimeMillis(); String ssTimestamp = ...


1

Most likely, Selenium is not in your class path, which appears to be exactly /Users/username/Desktop/workFiles/maven/MavenProject/target/MavenProject-1.0-SNAPSHOT.jar. It is surprising that you refer to this as a Maven project, and yet you choose to build it with Ant. Maven is also a build tool, and I believe IntelliJ can build using Maven if you ...


1

Failed assertion is nothing more than AssertionError which is a subclass of Throwable so you can treat it as any other exception. Example code: try { //some assertion } catch (AssertionError err) { //print error to the log //take screenshot //do whatever you want //do nothing } Usually it is being followed by finally block where the ...


1

I like Telerik Test Studio for web applications. It doesn't require any knowledge of programming and has an intuitive interface. The test runner can be put on any of the VMs you might be using. If it is not a web application, the only thing I have worked with would be AutoIT (which can have a steep learning curve).


1

Selenium IDE has a Rollup feature: Rollup – This option allows user to combine multiple test steps to act like a single command. Try to combine the click and the screenshot into a rollup with parameters. Some links: Rollup login example with paramaters: http://sanjitmohanty.com/2012/07/06/using-the-rollup-feature-of-selenium/ How to use rollup ...


1

Fixed the issue by removing '/' before the 'src'


1

Well, I solved it, but it might not be best practice. Basically, in each test method I assign that method to a current thread variable. targetThread = Thread.CurrentThread; and then, when the user presses the stop test button, i kill the thread. works like a charm. public void haltScript() { targetThread.Abort(); } of course, i'm ...


1

In order to run Webdriver commands on a remote machine, Selenium Server must be installed on that machine. What I usually do to enable IE and Chrome support is place the IE and Chrome drivers right alongside Selenium Server. I can then create a batch script with the complete command, something like: java -jar selenium-server-standalone-2.44.0.jar ...


1

At least one programming language initial knowledge is a must (syntax, basic entities, cycles, conditions, operators, etc.). Although the majority of tools offer record-and-replay capabilities, in most cases recorder test won't replay properly without modification. In regards to tools, it depends on the area. I'll list the most popular free and open source ...


1

Instead of downloading and using your own Selenium jars I would use Maven. Maven is used as a build tool and will download any dependencies you might need, like the latest version of Selenium. Steps: Download & Install Netbeans with JDK at http://www.oracle.com/technetwork/java/javase/downloads/index.html (Also install JUnit with the installer) ...


1

I did and do now, but you didn't go far enough with your model. The test engineer is part of a team, not a stranger dropped into it. Some, like Microsoft, take it to extreme and drop the "test" title altogether but let's focus on the more conservative case. As an integral part of a team the test engineer is part of the whole development cycle, not only for ...


1

Its always best decision to move for automation after some good experience in manual testing. There are lot of benefits of automation and you can do regression , functional and some other testing using automation. I would suggest you to start from Selenium web driver for automation. But before move to selenium you should have following skills : 1 - Basic ...


1

The below code should give you two weeks from the current date SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Calendar c = Calendar.getInstance(); c.setTime(new Date()); // Use today date c.add(Calendar.DATE, 14); // Adding 14 days which is two weeks from the current date String output = sdf.format(c.getTime()); Selecting ...


1

So selenium was created in java, so they have all of the advantages of updates and community for questions. I personally like C# because of my background with the .NET technologies. I know that people have recommended that I switch to java because of the community base, and how quickly things are updated for their technology. So to answer your question, none ...


1

From your question I'm assuming that you want to run your automation tests built using java one after the other using a batch file. Yes, you can run the tests using a batch file. Open a notepad and add your tests (binaries) like below and save is as YourTestFilename.bat echo off % java C:/Test/Test1 % java C:/Test/Test2 % java C:/Test/Test3 Or % java ...


1

You mention in the comments: What happens in my application is, after POSTing something, it takes sometime to update everything(indexing involved), for that specific reason we need to wait sometime and refresh the page, otherwise if I use wait for condition/wait until element is visible/wait until page contains/wait until page contains element , I cannot ...


1

I'm not sure what testing library (if any) you are using to execute the tests; I'm going to assume jUnit here, because that's what most people use for testing in Java. Similarly, I'm not sure if you're using ant or maven with this project. Using JUnit You can invoke the JUnit test runner from the command line using the following: java -cp ...


1

Their is more cloud site present for testing in mobile devices. (https://crossbrowsertesting.com/, https://www.browserstack.com/) N.T-- They are all commercial Enterprise service. You can try a demo for these cloud services in some limited devices or some few minutes.


1

Here's a sketch of the solution in Java: List<WebElement> list = driver.findElements(By.xpath("//*[contains(text(),'" + text + "')]")); verifyThat(list.size(), both(greaterThanOrEqualTo(1).and(lessThanOrEqualTo(3))); where I use: standard WebDriver methods to get a list of matching nodes verifyThat that in contrast with assertThat is a soft ...



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