Hot answers tagged

10

I don't know whether a certification is necessary for automation testing, but you definitely require good coding skills and logic development skills for it. Its advantageous to learn Java as its open source and hence there are countless forums and communities to seek kelp. Plus many of the automation testing tools (specially open source testing tools) use ...


8

Looks like XPath locator to me, but this is not all. TL;DR: Technical part of the question is just starting point to showcase your skills and experience. When answering such technical interviewing questions, goal (unless you are explicitly said so) is not to give shortest answer, but to start conversation where you can showcase your skills and experience. ...


6

If you want to do it manually, then you will have to trace the path from the root of the host up to where the element is being generated. OR There is an easy way to get the xpath. In Mozilla FireFox install Firebug addon. Then install Firepath addon. Now visit your web page. Press F12 to open Firebug console. Click on the Firepath tab. Inspect the element ...


5

I'll start a conversation by saying it looks like an xpath. Then I'll explain what element it is for and then start a talk about how it would work and share my knowledge around xpaths.


4

(Unit)Test-runners wrap their tests in a class for execution. You can place multiple tests into a single class. Often an annotation is used to show the class method is a test. jUnit uses @Test, MStest uses <TestMethod> and nUnit uses [Test] Personally I group tests that test the same part of the application into a single class. This way the class ...


4

Like Michael said the Page object pattern makes the finder easier to use. I try to maintain a pattern of having a test only verifying one thing or possibly one screen. In your example I would assume in your first test, you would be testing everything about the post being visible. In your 2nd test, the create a post step is only a setup step so that you have ...


4

I use the page object pattern myself. It addresses two main things: Defines the finder in one place Names the finder with english-like words Good things. However this doesn't address the issue of how to combine series of steps that are then used in multiple places. To do this you can use use functions / procedures / methods in the language you are ...


4

FindElements returns a collection of elements. What you need to do is use the singular "FindElement" to get a single instance of an element to work with. WebElement element = driver.findElement(By.name("q"));


3

XL Testview Have a look at XL Testview from XebiaLabs. Test analytics and decision support that spans testing tools See all your test results in one single dashboard Analyze test results across multiple test tools Track release metrics and quality trends over time Use real-time quality data to make the best go/no-go release decisions ...


3

In my experience, as you correctly mentioned, if creation fails, deletion cannot be even tested, so in fact you have just one test with 2 separate test conditions. So far for every separate scenario I have only one test with multiple test conditions. Test starts with preparing system to certain status, which will be irrelevant for other tests. Then all ...


2

Sameer is right in his comment. Using thread.sleep is a considered a bad practice. I would suggest you to use Explicit wait. Explicit waits would allow you to define your own wait conditions , based on conditions like presence of element located, alert is displayed or not. Here is a good tutorial on how to use Explicit wait. However, as a first approach, ...


2

Probably the elements you are looking for a updated at a later point in time. First the page is downloaded, then rendered and then the JavaScript is run. The element has not yet been created by the JavaScript. Maybe HTMLUnit does not process the JavaScript correctly. HTMLUnit is not know for its JavaScript implementation. Its primary usage is unit-testing ...


2

here's an example of a fluent wait method that I've integrated with my testing that will poll to see if an element is present every 500 milliseconds for 30 seconds before failing, you can call it and treat it like a regular WebElement so it may be helpful in this case public static WebElement fluentWait(WebDriver driver, final By locator) { ...


2

Try to form the Xpath like //div[@class='promptChoiceListBox']//input[@id='saw_3005_7_1'] Please check the script by finding the element with the above Xpath. Hope it will work because if you take only div tag it will give entire drop down ,but we just need to click on the drop down symbol button in the region of your image added above.


2

Well, this depends on your application. At a former location there was a database that orders was injected into after initial processing, by injecting into the database directly I was able to make millions of orders in a matter of minutes. This will usually bypass many parts of the system (Payments, Inventory validation etc). If those pieces are not being ...


2

We have a bunch of selenium test cases and could observe a similar behavior. We dug into the issues and figured out two things: Make test cases "orthogonal" Test cases should not depend on each other. But that also means that every test case is responsible for creating the correct precondition for itself to run. Don't make any assumptions about the ...


2

The getText() method returns all the text within a HTML element. In this case all the text between the start <a> and the end </a>. This includes other tags and their contents. Try to split the string on white spaces and use the first word found. String value = getText(); String[] words = value.split("\\s+"); String result = words[0]; Now ...


2

As I understood the question, it is required to define the reusable methods and use those methods in different test cases based on the requirement. Here I am writing the code for two individual methods to work with,... public void inputKeys(WebElement we,String ip){ we.sendKeys(ip); } The above code just type the string value referred by ip variable. ...


2

You can try below xpath //*[@class='item']/div[text(),'Logout']


1

I used a helper function to see if at least one element still exists. Because I'm finding a new element each loop, StaleElementException doesn't occur anymore. while(isElementVisible(d, (By.ClassName("search-choice-close")))) { d.FindElement(By.ClassName("search-choice-close")).Click(); ...


1

This worked for me in webdriver.io var webdriverio = require('webdriverjs-angular'); var options = { desiredCapabilities: { browserName: 'firefox' }, ngRoot: 'html' // main application selector }; var wd = webdriverio.remote(options).init(); var wd2 = webdriverio.remote(options); ...


1

Certifications don't teach testing. Still if you want to go for one, well, there are several available out there. But, they don't teach you how to test, they mostly teach only a certain terminologies. Yes, learning a programming language is an added advantage for a tester, especially for someone who is looking to make a career in automation testing or ...


1

The question and the description that you have written for it are misleading. I'm assuming you want to know which certifications will help you get a start for your career in Software Testing. Well for that I don't think you need to go for any certifications. Read good blogs and article on testing. There are thousands of them available on the internet. ...


1

Everything enclosed within the <a> </a> tags is considered as part of the link text. So if you use the getText() method of Selenium, you will get the whole text. If you want a part of the text, you should try to shed the unwanted text. Get the text and store it in a String variable. Trim the unwanted text from that string and you will have ...


1

Python is widely considered as best language for beginner programmers. Java puts more focus on generating fast code (which adds requirements on programmer). Python is substantially more forgiving, and for website testing, speed is not the first requirement (flexibility is, where Python shines). Also, if you want to be programmer, you need to improve your ...


1

Actually java or other languages could be good option to drive Selenium tests, but it is not a must. You can command WebDriver from many different languages. Ruby, java, C#, VBA, VBS, javascript. Thanx to WebDriver you will have possibility to run your tests in multiple browsers (Chrome, Firefox, IE, Safari...). But all the languages are just a plus. If ...


1

The above answer by QAMember should be correct. You can also try this xpath //div[contains(text(),'Logout')]


1

PDFs and ePubs are shown in the browser with plugins. Selenium cannot access these documents. If you use Windows you could have a try with AutoIt. On Linux and Macs I think you have to fallback to something like Sikuli after the document is opened. Some reads: AutoIt and PDFs: http://autoitsourcecode.blogspot.nl/2013/05/pdf-automation-using-autoit.html ...


1

It will be good to do this with firepath, it works well for Firefox browser. And once you know the path you can implement the same (litle changes might be need for explorer though) for other browsers. Please check the link, it has a better explanation for locating an element


1

This is super odd, in terms of your code though, everything looks correct. the problem does not seem to be on your end. If you call the click method, and selenium times out AFTER the browser performs that click, then the problem is likely with the return trip from the browser's embedded http server that your tests communicate with. Your stack trace also ...



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