Tag Info

New answers tagged

0

I think you will benefit if you research the following: Basics of Java (as pointed out in other answers): You may need to know some libraries/concepts like: Apache POI: To read/write to excel files, in case you read test data from an excel file and pass it to your test script XML Parsing: In case you pass test data from an XML file TestNG: Testing ...


3

Try to use driver.findElements instead. It returns a list of all WebElements. All means also the not visible elements. Here some code to iterate thru the list and only do something with the displayed items. List<WebElement> elements = driver.findElements(By.className("vfmThumbnail")); java.util.Iterator<WebElement> i = elements.iterator(); ...


1

If you want all elements that match your selector, use findElements. This will return a list which you can iterate through. List rows = wd.findElements(By.className("vfmThumbnail"));


2

You are getting a nullpointer exception because you're trying to assign values to index locations in a null array. This statement String[] tradeId = null; should be String[] tradeId = new String[list.size()]; so when you later do this: tradeId[i] = str.substring(s.lastIndexOf('-') + 1); There will be a space in the array reserved for that value. ...


0

The solution I would use is the WebDriver's driver.switchTo().frame() method (as per your example) You can select the window you want using; A number. (0 based index) A name or ID. A previously found WebElement. an example driver.switchTo().frame(driver.findElement(By.className("uniqueElement[title='The Page You Are After']")));


0

To perform a 'mouse hover' action, you need to concatenate all of the actions that you want to achieve in one go. With the actions object you should first move to the text box, and then move to the edit icon and click it. Below is my attempt at sample code to perform Mouse hover; //Move to the Textbox Actions actions = new Actions(driver); ...


3

How do you come to 23 in tradeId[i] = str.substring(23);, your strings like trade-summary-92222 are only 19 characters long, not? 19 - 23 = -4, which is what your errors says its can't find the last 4 characters. For readability and a partial string you could use: public String substring(int beginIndex, int endIndex) Your code would become: tradeId[i] = ...


0

If you want to write your test-cases in Python you could have a look at http://marathontesting.com/ as I found in this SO post. As I understand the MarathonITE supports Applet testing: http://marathontesting.com/tutorials/page/2/#!prettyPhoto[]/1/


0

You are comparing apples and oranges. Selenium works off the DOM, not off the page source. For a more fair comparison, try opening the browser debugger and searching for "cloud front".


1

Server monitoring is more a operational task then testing, have a look at http://serverfault.com/questions/44/what-tool-do-you-use-to-monitor-your-servers most server monitoring tools have an API that can be used to get the info from a programming language. I would have a look at the open-source Nagios it has Java API plugins: ...


1

No magic bullet. If you have a "multi-tenant" schema -- a schema that represents multiple, independent sets of data -- you may be able to run each concurrent test in a different data set. It is hard to be more specific about this without knowing more about your database, but here is an example. Consider an application as a service for managing ...


0

I won't add the same as what's already been said, but.. I noticed one of your selectors is by option value 293, or similar As a rule of thumb, try not to use numerical or 'generated' selectors on things like this, as if there were another option added to the drop down you might end up selecting a totally different option.


0

Hey there's two issues here: A) you're calling ToString on an IWebElement. Try calling vele.Text instead of vele.ToString() instead. This will get you the text of the element rather than a taxi representation of the IWebElement. B) you're using an xpath selector, but you're telling Webdriver that you want to use css selector to locate the element. You can ...


0

Why use XPath in your CSS selector? Just try this (assuming your selector is correct for the page you want to test). WebElement vele = driver.findElement(By.cssSelector("#Result h2")); You need to get the text of the WebElement. What you're doing is converting the webElement object to its string representation. Use this method instead: ...


0

I am not able to access Ebay in my pc because of some firewall restriction , but I can help you by example : You will need to use Select object to select value from dropdown. For ex : driver.get("http://www.toolsqa.com/automation-practice-form/"); Select sel = new Select(driver.findElement(By.id("continents"))); sel.selectByVisibleText("Australia"); So ...


2

The best way is to separate out the details of the WebElement and methods to do with clicking on it, into separate classes - keeping a separation between the code which directly interacts with the UI and the code which does the testing logic. This is a design pattern called the Page Object Model, and your code will end up looking a bit like this: package ...


0

I am not sure on how to get the Selenium version through code. I dont think there are any methods to do so. But, the version is clearly mentioned in the CHANGELOG file that comes along with your Selenium installation. You can read the version from this file. Below is the content of the log file: v2.43.0 ======= WebDriver: Updating Native ...


0

Please post your frame html code. Make sure your driver is switching to frame successfully. Is Content your frame name? You can switch to frame using three different ways. driver.switchTo().frame(<frame name>); driver.switchTo().frame(<frame index>); // Zero- based index driver.switchTo().frame(<frame element>); // use driver.findElement ...


1

If you have some input fields, most likely you also have some limitations related to max. number of chars which user can enter there. Let's say you have text input field which allows user to enter up to (and inclusive) 255 chars. In this case simplified test scenarios will be: User enters any number of valid chars (the number of chars should be <255) ...


0

You should write on programming language which you know better and make sure that your colleagues familiar with Java or Python in case of your support. I guess your question has answer and you should start to write on Java. But you will not get any pain if you will try to learn Python because Python is easier to understand in my opinion.


0

The answer to your question is dependent upon your familiarity of the programming language. You should use the language which you are more familiar with and feel comfortable using it. When you will be writing scripts, you will have to implement complex scenarios, which will require you to write complicated logic and once you are done with it, in the future ...


2

A quick search for Selenium tests on github results in multiple open-source projects hosting their test cases there. Wikia: https://github.com/Wikia/selenium-tests Jenkins CI: https://github.com/jenkinsci/selenium-tests Mozilla Addons: https://github.com/mozilla/Addon-Tests Other open-source project sites look at: http://sourceforge.net/ ...


1

At this point of time it doesn't matter which language you'll start with, 'cause both are relatively easy to learn considering the number of educational resources available. The more important thing is the language your application under test is developed with. In case when the application under test written in Java and you do your automated testing ...


0

According my experience JAVA is better if you think about scope and career. I agree with @user246. Also you will have vast area , lots of tutorials to use java with selenium. If you have good command over python programming then you should not switch to java for selenium.


0

Selenium + Java has a lot of tutorials / examples / documentation available. I believe there's plenty of documentation available on using TestNG in Java or the ATU Graphical Reporter if you are into designing automation framework or reporting structures. So, you might find it easier to start Selenium with Java.


0

They work equally well. If you have never programmed before, it may be easier to start with Python. If you want an eventual career as a developer, you will eventually want to learn Java.


0

Assume that your text box has an ID eg: app_title, you can hover over it using element = @driver.find_element(:id,"app_title") @driver.action.move_to(element).perform This will place the mouse focus on the textbox and you will see your edit icon on the screen. After that it is simple, you can click on it using ...


0

is it any way to get object by combining UI elements in such way: hp.get(Widget.class, "Page name").get(Link.class, "Link name").click



Top 50 recent answers are included