Tag Info

New answers tagged

-1

Please help me automate all my Download file And Upload File link from top to bottom.


2

Normally both your home and the company networks are fire-walled, letting no external traffic in. There are two possible solutions: Poke holes in the company firewall for Selenium traffic back and forth Create a VPN-tunnel between both Poking holes Make sure the firewall and routers forward any traffic on port 4444 to the company internal Selenium hub ...


0

Try to access the element on which the clicks are getting missed using CSS selector rather that id or xpath. This worked for me


2

If you're trying to register 100 accounts, this is a simple addition to your code to do that. for i in range(100): email_address = "money" + str(i) + "@qa.test" firstName.send_keys("mike") lastName.send_keys("mano") emailField.send_keys(email_address) passwordField.send_keys("test12") submitButton.click()


0

you need to add the "selenium-server-standalone-version.jar" since your server runs against that. I guess you would have added "selenium-java-version.jar".


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 ...


2

You also need selenium-server-standalone-version.jar, because the tests run against a Selenium server. The test starts the server, then it starts the test, the server starts the browsers and the test communicates over the server to the browsers. Duplicate of this SO question, this also contains possible other solutions, it describes possible other jars ...


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

I used NUnit originally when I wrote my C# cases. Turns out NUnit did Not support parallel running of cases. There is however PNUnit which does do what you want(now integrated into the latest NUnit but is still documented as PNUnit). There is some documentation and examples here


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); ...


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 the menu title, and then move to the sub menu item and click it. Below is my attempt at sample code to perform Mouse hover action using your paths; 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] = ...


1

I would always vote for hand-coding automated test over the use of Record and Playback. With programming test-cases its much easier to keep the tests DRY and if you think about maintainability of the tests up-front this will safe you a lot of time in the end. Some record and playback tools do support cutting up recordings in pieces and or replacing ...


0

I think a set limit does not exist and tests should run until you stop them. I do wonder if you really need to check all pairs and if isn't that easier checked in a unit-test. It should also be possible to write unit-tests for JavaScript actions that populate drop-downs. Check only a couple of pairs in the actual GUI, because testing all pairs with Selenium ...


0

Most test runners support running tests in parallel. I am not really into C#, but have a look at these posts: http://blog.yauheni.me/2009/12/design-of-selenium-tests-for-aspnet_19.html http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx ...


0

Instead of using a sleep I would wait until more then one window is present. driver.getWindowHandles().size() returns the number of windows, it should be one more then before the clickButtonForNewWindow action. long endTime = System.currentTimeMillis() + 10000 while(driver.getWindowHandles().size() >= 1 && System.currentTimeMillis() < endTime) ...


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

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 ...


0

You might installed SDK Studio, If yes, use below configurations. It is worked for me. export ANDROID_HOME=/Users/ivcmbp020adm/Library/Android/sdk export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


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 ...


1

Selenium standalone jar and testNg jars are missing . So just keep these jars in you Lib folder and this will resolve your problem. Since in build.xml you have provided jar location to lib folder. So please keep all your jar files in lib folder and this will start working without showing any error. Good Luck


0

Your className selector isn't working, because those are two different class names - you can't use both at once. Try either of these selectors to see if they find the X correctly: driver.findElement(By.className("fancybox-item")).click(); or driver.findElement(By.className("fancybox-close")).click(); But remember to double-check that there aren't any ...


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 ...


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

Just a wild guess without any testing, but shouldn't it just be: find_element(:xpath,"//*[contains(.,'602384710')]../..").click The problem is that when searching with the results of a find_element it cannot go back up the tree anymore, from then on it will only search within the already found results.


0

I have tested this XPath online. Please try: //a[contains(.//div,602384710)]


0

Your if statement feels like it's not even there because when your test encounters and exception and dies, that if statement effectively is not even there. The line of code that is dying is this: xpath = driver.find_element_by_xpath( "/html/body/main/div/article[2]/div[4]/header/div[2]/div/div[4]/a") Your if statement never gets a chance to run. This ...


0

You have two options. If you're using findElement relative to another WebElement, your XPath needs to start with a dot (the element as your starting point). See the accepted answer in this topic. Alternatively, the XPath contains goes looking in child nodes too. You could try to immediately target the link element like so: "//a[@class='tv-card-link' ...


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 ...


0

I found this article that describes Selenium architecture and how Selenium works. Quote from the article: WebDriver controls browsers that are running in other processes. Although it's easy to overlook it, this means that every call that is made through its API is an RPC call and therefore the performance of the framework is at the mercy of network ...


1

Yes, it most certainly does. Selenium can only address elements once they're loaded, but that loading (controls, ajax calls, ...) is depending on your connection (and browser). In fact, I had a perfectly working script with nice explicit waits for our test environment. But the execution on the production website went bad in places, because the ajax calls ...


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

This is how it can be done - Download selenium from here https://pypi.python.org/pypi/selenium Assuming that you are on windows use - python setup.py install Download IEDriverServer.exe and put it in your path from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Ie("C:\\Python34\\IEDriverServer.exe") //Your ...


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 ...



Top 50 recent answers are included