Tag Info

New answers tagged

2

I am only working with Page Objects which makes it pretty straightforward to keep them inside the page object where it is used, meaning inside a class. Actually this way you are accomplishing some things that are important for successful automation projects: DRY principle (only this one class contains and cares about your xpath) Ease of use (no ...


0

There is also the long option which uses selenium's element displayed functionality. W3C specifications for element displayed Python example: from selenium import webdriver b = webdriver.Chome() b.get('https://google.com') els = b.find_elements_by_css_selector('*') hidden_els = [el for el in els if not el.is_displayed()] print(hidden_els) b.quit()


0

If you want to be a greater tester, you need to cultivate a mindset of curiosity and skepticism. Without that, knowing tools and frameworks is useless. On the other hand, not knowing tools and frameworks will slow you down. That knowledge is not sufficient, but it's necessary. If you expect to read your developers' code, you should learn whatever ...


0

I will go for Python because of it's simplicity. Python code looks readable and can be easily understood and even others who have very limited programming skills can also join in later phase of automation to accomplish voluminous scripting/data addition work if you have put a nice data driven framework.


1

In the data provider, pass another string to indicate whether to execute the assert or not. Change your assertTrue to check for that. Something like following: @DataProvider(name = "VINNumbers") public String[][] VINNumbers() { return new String[][] { {"2T1BU4ECC834670", "true" }, {"1GKS2JKJR543989", "false" }, ...


1

Joe is absolutely correct. Imagine you have been given a duty to prepare a tea. You have been given a tea pan, and the ingredients to make tea (water,sugar, milk, tea leaves, and some ginger as well ). All these ingredients are from different brands. Consider the tea as your end product and the ingredients to be the various components which will allow you ...


1

You can enhance your java-Testdriver scripts by datadriven ability. With such, you can do much more tests with single script. Disadvantage is, you have to think about maintain datasets for different tests. Datadriven testing is followed by technology leaders as Tosca Testsuite. Another thing you can try with Selenium is mastering Xpath to make better and ...


3

is there any package of different toolkits and frameworks that if I learn them I could call myself a good tester? Good testers aren't defined by a magic set of toolkits and frameworks. Good testers are defined by their ability to test in lots of contexts - automated, manual, etc. In particular, good testers are good thinkers who can understand the ...


3

Oh Boy! you might start another one of the Java vs Python vs Other language war. These are kind of question which are always answered with preference for a specific language in mind. For me- I would prefer Python over Java, because of one reason : Its simplicity. Our test team comprises of people who have little programming experience. However, most of ...


2

Is there any specific reason to pick Java over Python? Not really. It depends on which language you feel more comfortable with. However, most of our developers (apart from the iOS devs, obviously) are intimately familiar with Python and are using it in our production environment. So go with Python. Then Devs can also contribute to e2e Test ...


0

If test is running successfully on other browser then there is configuration issue of IE on machine. Make sure version of Selenium, IE driver and IE browser are compatible Ref. selenium release log Also verify required configure mentioned here


0

The issue is with the IE versions, your machine should be having both IE versions i.e. 32-bit and 64-bit and when you start the 'IEDriverServer.exe' it calls the 64-bit IE version while you are using 32-bit IEDriverServer.exe. I faced this issue too and observed that when any tool starts IE then 64-bit IE is launched by default (I was on Windows 7 and IE-9), ...


0

Usually I keep them in my code specially during the implementation and before SUT is stable. Also when it is in the code, you have more control who/how can access and modify them. On the other hand, keeping them in a separate file can help in: Updating them easier Having separate XPath files for different environments and switching between them based on ...


0

I know your post is quite old, but there is a library for testing PDF content: https://github.com/codeborne/pdf-test Very easy to use. Just write on assert like this: PDF pdf = new PDF(new File("src/test/resources/50quickideas.pdf")); assertThat(pdf, containsText("50 Quick Ideas to Improve your User Stories"));


2

Unfortunately, I don't think there is enough information to make any alternate suggestions. It would be better if the popup has some visible text that's unique enough then you can use it for identification. Also, when you say popup, do you mean A dialog box? Or, An alert? Or, A lightbox component? This is one way in which you can get to that ownerId ...


1

FDM has the right idea. Since his example is C#, I thought I'd provide a Java equivalent: /* * Returns true if the at least one element is found. * If none are found, a list of size 0 is found. */ public boolean doesElementExist(String id) { return driver.findElements(By.id(id)).size() != 0; } This example is very basic and doesn't try waiting for ...


1

According to the official documentation, findElement should not be used to look for non-present elements, use findElements(By) and assert zero length response instead. It's easy to put that in a wrapper method, and temporarily reduce the implicit waiting time to a very low number. An example in C#, kind of: public static bool ...


0

You can refer to this question asked by me I found portals built using qlikview charts rather very complex & tricky to automate using selenium.Find a demo here


1

I am not sure Selenium is the right tool to test JSON API's. JSON Viewer: But you could add a JSON viewer extention to the browser: Chrome: https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en Firefox: https://addons.mozilla.org/en-us/firefox/addon/jsonview/ Internet Explorer: ...


1

I can tell you the approach, because we have we used similar thing in our project but not with Selenium. I think this will work with Selenium too. First you need to open the text file in browser (Firefox) using Selenium (this can be done, launch browser and set the navigation URL which should be the path of that text file) and then move your focus to that ...


3

What you are experiencing is a fast-fail type of behavior when you use .findElement . You don't really need to use .findElements(el) to get a soft-fail behavior. What you could do is something like this instead: protected void checkElementPresence(final WebDriver driver,final By by,final String errorMsg){ new ...


2

(note I haven't tried this in java, but this is how to do it in C#) You should place the findelement in a try/catch block, so that if the element is not found you can catch the exception and do the correct thing. It would look something like this: try { driver.FindElement(By.CssSelector("selector")); } catch(NoSuchElementException) { ...


1

Use findElements instead of findElement. findElements will return an empty list if no matching elements are found instead of an exception. To check that an element is present, you could try this Boolean isPresent = driver.findElements(By.yourLocator).size() > 0 This will return true if at least one element is found and false if it does not exist. ...


1

There are two sides of your question which I am interpreting (and may be I am wrong), but this is how I see it : You can choose your language based on the ease of learning. You can choose your language based on the support for that particular implementation. Let's talk about first- I have used both Python and Java implementations and I agree with Peter, ...


0

According to the TIOBE Index Java is still the number one language for programming. Java will also net you the most online support because of this on for example Stack Overflow. JavaScript is becoming more popular though, certainly with the rising of NodeJS. I would bet on JavaScript more then Java or C#, since its the language of the web. For a decent ...


5

I am assuming that you: want to become competent programmer, with goal to learn programming beyond Selenium automation. have nobody around to ask for guidance (if you do, ask locally) also want to be able to write simple tools supporting QA tasks, and beyond. Python is widely considered as best language for beginners (MIT among others). It works much ...


7

See, you can learn Selenium with any language whether it is C#, Java, Ruby, Python etc. It doesn't matter application which you are going to test has been developed in which language, you can test the C# application in Selenium with Java. In addition to it, you don't need to learn any of these language completely for working with automation. You should know ...


0

If you want to learn from scratch I think that Java will be good, because there is a huge amount of support from the community in this language (I think most of the people use Java with WebDriver). I've started with Java and for any question or trouble there always was somebody that could help me. Now I'm using Python with Selenium, and experience that ...


0

For Working on Selenium WebDriver with Java , you can focus on below Java concept and other related stuff, I am just giving you bigger picture. Java Basics (oops concept & programming concept) Java Collection Framework Java FileOperations (using apache POI or Jexcel) , ExceptionHandling , logger would be plus point. Junit or TestNG to start with unit ...


0

The level of Java knowledge depends on what you want to do with Selenium. You may just want to write some simple test automation scripts in which case basic Java knowledge is sufficient. If you want to make your test automation code re-usable, then object oriented programming concepts are important. If you want to create a framework, then learn advanced ...



Top 50 recent answers are included