Hot answers tagged

6

I've tested using format http://user:pass@host and it works. So in Python (in setUp() of MyClass(unittest.TestCase) class) this should look like: self.base_url = "http://user:pass@host" In Java based on #34 at code.google, the following code should work as well: public void login(String username, String password){ WebDriver driver = getDriver(); ...


3

The most prominent load testing tools as for now are: Apache JMeter Gatling Grinder Tsung I would recommend checking out Open Source Load Testing Tools: Which One Should You Use? article which provides enough information to decide which one suits your needs in the best way. Personal recommendation: if your project is based on Jasper Reports it means ...


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


3

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()


2

data-href is an attribute of a HTML tag, try to use get_attribute method, something like: url = browser.find_element_by_xpath("//a").get_attribute("data-href") For more information see: http://selenium-python.readthedocs.org/en/latest/api.html#selenium.webdriver.remote.webelement.WebElement.get_attribute Or this for examples: ...


2

If you are testing for a specific image at a specific resolution then you could either compare the image with the reference image or quicker calculate the MD5 of the image and compare it with the expected. Be sure and wait for the page to be loaded, including images, before validation.


2

You can put ChromeDriver wherever you like if you specify the path: chromedriver_path = "<path_to_chromedriver>" driver = webdriver.Chrome(executable_path=chromedriver_path) It's really up to you if you want in usr/local/bin or elsewhere.


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


1

So after some deliberations and code changes (not much), I was able to port the HTMLRunnner code to Python 3.0+ compatible mode. I ran a simple test suite using the HTMLRunner and I can see an HTML report created out of it. It's not as fancy as Allure but it does the job. Another option suggested by @Amazpyel is Nose, although I haven't tried it out yet. ...


1

Ok, this is very old, but the answers in here are focusing only in language independently that he said he wanted to use appium. If your devs had a clear preference, then go with that, if not, then I would say go with java, because the java-client its kept more updated and the community using java is way bigger. python client: ...


1

@Brenden In my experience, it is better to keep the validations as close to the end user or top of the stack as possible and have the underlying workers be as generic as possible. In your case, you should probably even consider moving the validation from classB to classA so that your classB is free of the constraint and becomes a bit more generic to be ...


1

I am currently working on an angular app with python/selenium e2e tests. The main difference is that protractor offers not just selection logic (model, binding, etc.) but also implicitly waits for angular page load, url changes, model updates. To make up for these missing pieces. We had to have a fair amount of explicit waits. I have not used it ...


1

The problem could be that the page in the new window is still loading while you are trying to interact with it, so you might need to add in a wait condition. When I've done this, I've added in waits to make sure that the new window has actually been opened, and then to make sure the page in the new window is loaded. from selenium.webdriver.support.wait ...


1

Splinter does not support find_by_class_name. Splinter has support for find_by_option_by_text and find_option_by_value but it does not look like you have the option tag in the html. Try using find_by_css instead for the list elements. This code snippet assumes your list items are visible: browser.find_by_css('.option1') If they are invisible, you will ...


1

If I understand correctly, you're working with an n-tier system that communicates via something resembling an API. Given this assumption, I'd build a framework that allows the creation, transmission, receiving and parsing of messages to and from the application. At this point your actual test data can be in any format, and don't need to be coupled to your ...


1

The way I corrected this was to manually copy the ddt files from /usr/local/lib/python2.7/dist-packages to /usr/local/lib/python3.4/dist-packages Copied the following two files : ddt.py ddt.pyc and the directory ddt-1.0.0.dist-info If any body could come up with a better solution, then please add your answer. It would be more than welcome :)


1

Try and convert this to the Python equivalent. Check this link: For Firefox: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference( "intl.accept_languages", "es" ); WebDriver driver = new FirefoxDriver(profile); For Chrome: ChromeOptions options = new ChromeOptions(); options.AddArguments("--lang=es"); ChromeDriver driver = new ...


1

Your setup method should be setUp for unittest. I'm not sure why they decided to name it that way, but that's just how it is. Since setup is not a keyword it's not getting called, thereby making self.driver throw an AttributeError.


1

read up on Select object - http://selenium-python.readthedocs.org/en/latest/api.html?highlight=select#module-selenium.webdriver.support.select Use IDs or names, or even CSS before XPATH. Best practices, explained here


1

I was able to answer my own question, Please see script below: urlTextBox = "url" dropdownOption = "location" submitBtn = ".//*[@id='start_test-container']/p/input" homeBtn = ".//*[@id='nav']/li[1]/a" webTeamPage = "personalwebpage.com" select = driver.find_element_by_id(dropdownOption) #get the ...


1

I've figured out how to deal with this issue. I used the Visual Event tool to determine that edits to data in the text box triggered the JQuery change event. Next, I learned a bit of JQuery so that I could use it to set the field value and fire the change event. Finally, I replaced my original code with the snippet below. ...


1

For automatically testing an API in a CI/CD scenario, try Runscope. It integrates with several build/deploy tools, including Jenkins (see Jenkins integration instructions here). In fact, I just put out a Jenkins plugin for Runscope that makes it super simple -- API tests are just build steps. You'll find GitHub link to plugin on second link above. You can ...


1

The problem is that you don't switch to opened window, and webdriver searches for elements in the old page instead of the newly opened one. Solution: String winHandleBefore = driver.getWindowHandle(); for(String winHandle : driver.getWindowHandles()){ driver.switchTo().window(winHandle); } This java method's part switches to ...


1

I hope below given points may help you strong to see how this can be done: Find a web page which contains a broken image. Or you can create in your local system. Open your class file and write a code to locate an image such as below. You can use different image attributes(Eg. alt, name etc.) to locate image using XPath. WebElement ImageFile = ...


1

I had used browsermob-proxy and its Python client successfully in one of my project by using rewrite url to load mocking content. browsermob-proxy is a proxy server for the browser to connect with during testing. Assume you are hosting a webserver with mock content on localhost:8899, below example will load the mock content whenever the browser try to load ...


1

Try out Galen; it's designed for testing responsive web design across different platforms and different sized viewports, so its all about how web elements are laid out on screen: Layout testing seemed always a complex task. Galen Framework offers a simple solution: test location of objects relatively to each other on page. Using a special syntax and ...


1

It rather sounds like your first port of call should be talking to your development team to find out exactly what processes are affecting the text entry. There's definitely something moer than you know if those steps aren't providing results.


1

Does your element put inside in iFrame? If it's in iFrame, you should switch driver to that. OR Could you try with element = driver.findElement(By.cssSelector("div.clearfix.stk_btm_toptabs.text-center>a.stk_btm_chpFlight.active"));


1

Here's also a good list of Python test tools from automated-testing.info community.



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