Hot answers tagged

4

Test automation is not high-end coding. You will not become wealthy doing either test automation or unit testing. Typically, unit-testing is not a separate job title. Experience with unit testing is more likely to lead to a career as a developer than Selenium automation. You are likely to make more money as a developer than as a tester.


4

Try sending an empty key to the element in order to focus on it as well as set get visible over hidden property. For example: hidden_element.send_keys "" // This will make element visible first. hidden_element.click() // Pretty simple job when element is visible.


2

You can ignore javascript errors by changing WebClient options. You just need to extend HtmlUnitDriver class in such way. public class CustomHtmlUnitDriver extends HtmlUnitDriver { ... @Override protected WebClient modifyWebClient(WebClient client) { WebClient modifiedClient = super.modifyWebClient(client); modifiedClient.getOptions()....


2

Separate your actions on a webpage from test cases. Follow Page object pattern/framework. You can use junit or testNg unit testing framework to write your test cases. I would advise you to use testNg as gives you lot of flexibility. Now you like to validate all 8 steps that you want to execute, now the question is what if first step fails, what do you want ...


2

Selenium can only do what user can do in the browser (that's the whole point). So if user can access logs from the browser (which will have to be a service by that third party), you can do it with selenium. If not, you cannot (so your logs are safe from any lurker).


2

(Disclaimer, I didn't test this. It may not work as is, but hopefully will at least give you an idea about a possible solution) You could try something like: Har har = proxy.getHar(); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { har.writeTo(out); } catch (IOException e) { e.printStackTrace(); } InputStream in = new ...


2

The simplest approach is to use the 'Base URL' in IDE. http://www.seleniumhq.org/docs/02_selenium_ide.jsp#using-base-url-to-run-test-cases-in-different-domains The Base URL field at the top of the Selenium-IDE window is very useful for allowing test cases to be run across different domains. Suppose that a site named http://news.portal.com had an ...


2

I would have 4 types of tests: unauthenticated functionality authentication ('login') tests for happy and sad paths tests for content for user type 1 (admin?) tests for content for user type 2 (standard user?) I don't know your framework but those are the high level groups. Within each of those I would have detailed tests for specific functionality and ...


1

@Lyndon, Completely agree. @Rajesh, Its not the area of Selenium. Its open source framework for web-automation and now they have extension of it for mobile platform called as Appium. Not possible using Selenium!


1

There might be slight differences in behavior of different browsers (because they are written by different teams). Selenium tests can be flaky - fail, and later pass with no changes. As with many Open Source tools, documentation might less than perfect. Reference docs is there but examples might be scattered over blogs. This is rapidly improving recently. ...


1

That was what I had previously believed also (because I've done dev) until my current position whereas the director is my source for this who actually sees the numbers. Although, maybe its more specialialist thing. You generally don't become wealthy as anyone's employee.


1

I seeing that this is C#, so not sure if this would work. But you can use a new variable, whose type is WebElement, something like this WebElement ele = webdriver.FindElement(By.Xpath('Xpath_that_you_have')); Please note that you need to replace Xpath_that_you_have with the actual xpath that you have mentioned. then, use this ele element and find the ...


1

You can try various TDD framework, I have used Robot before and it was really good. http://robotframework.org/ You can also take a look here, http://toolsqa.com/cucumber/cucumber-tutorial/ Robot and Cucumber both offer a high level of selenium scripting.


1

You can access a logged entry from Har object at runtime. For instance, the following code will return only those entries (tuples of a request and a response) with HTTP POST Request: Har har = proxy.getHar(); List<HarEntry> matchingEntries = har.getLog().getEntries().stream() .filter(e -> e.getRequest().getMethod().equals("POST")) .collect(...


1

We cannot perform image recognition in selenium, following way can be used. Upload image with unique file name (Probably appending the date and time to image file) Verify the after new image name file name in the image tag is what you uploaded. P.S: For image recognition you can use open source automation tool which is based on image recognition called ...


1

I think you are trying to detect if elements are overlapping. You will need some way in the clientside to tell you if two elements are colliding. I would try jQuery collision for this or some custom JavaScript code. Add or inject jQuery and jQuery collision to the web-app under test Use the Selenium javascriptExecutor to fire a collision detection on two ...


1

If this overlapped texts belongs to single element, lets say label, or text field. You can locate that element and use "webElement.Text.Contains("the text you want to validate");" method to validate your expected text. And if the overlapped texts belongs to different element, you can simply locate that specific element and validate the text of that element. ...


1

In addition to choose one non-leap year and test against 29th Feb; expected to fail choose one non-leap year and test against 31st April; expected to fail choose one leap year and test against 29th Feb; expected to succeed choose one leap year and test against 31st April; expected to fail I would consider adding more positive tests at day (time), month ...


1

A Platform independent way to create folder would be something like:- File rootDir = File.listRoots()[0]; File dir = new File(new File(new File(new File(rootDir, "Users"), "xyz"), "screencapture"), "new folder you want to create"); if (!dir.exists()){ dir.mkdirs(); }


1

This should be quite simple with xpath: //li[@class='open']//a[text()='Patient List']


1

I haven't found a way to do a 'mouse over' option but you can use Action Chains to achieve this. Actions action = new Actions(webdriver); WebElement we = webdriver.findElement(By.xpath("expression")); action.moveToElement(we).moveToElement(webdriver.findElement(By.xpath("expression"))).click().build().perform();


1

The choice of a browser depends on your goal. If you are testing GUI rendering and JavaScript execution you should always tests against those browser that your users/customers are using. So even if, for instance, Internet Explorer is slow and unhandy, it make sense to test against it, while if you don't find any bug with PhantomJS it does not mean much, ...


1

You can create a selenium project and post it into Github, then mention it in your CV. You project should use many basic selenium statements. In my opinion, your project should cover 36 lessons of this course (from lesson 50 to lesson 85). I hope that this will help.


1

@Jakob - Found you again :) public void waitForElement(WebElement value) { // wait for field WebDriverWait wait = new WebDriverWait(ad, 60); wait.until(ExpectedConditions.visibilityOf(value)); System.out.print("."); } Hope this will help ! Take up if you have any questions.


1

@Jacob No need to declare/initialize two different WebElements for this. I would suggest solution - After login.click() Use method WaitForPageReload() [Please confirm whether your code really working and waiting till page get loaded completely] Once Page get loaded, Assert for AnyField [Which should be uniquely displayed only after successful login] Now, ...


1

We are looking for a test management tool similar to Quality Center I would actually suggest that the equivalent tool does NOT exist. My experience over the past few years is that you have to pick the programming language and the test automation framework within that language. Even with test frameworks though, you will still need to manually write the ...


1

I also use the below to check for my jQuery. ((IJavaScriptExecutor)Driver).ExecuteScript("return jQuery.active");



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