Skip to main content

Posts

Showing posts with the label python

Testing WEB Sevices and Automating SOAP Services

Web Services are server and client applications to interact with rest of the world over HTTP, or sometimes over SMTP. It is written for accepting requests and giving appropriate answers for each requests. It is assumed that it returns the same response if there is no changing in the request and the condition. Therefore testing and automating Web Services are very easy. You just need to know sending and receiving data and condition, then the rest of the jobs is playing with data and assertions. Information about the  Web Services  should be present in  Web Services  documentations and it should be understandable to the people from third party system.  Web applications take to the next step with the  Web Services  because you can open your system to rest of world without requiring language specific restrictions. This makes integrity of applications very easy. To be able to integrate two or more system, you just know that you are sending some data and receiving data.  I had a t

Page-Object Pattern for Selenium Test Automation with Python

Page-object model is a pattern that you can apply it to develop efficient automation framework. With the page-model, it is possible to minimize maintenance cost. Basically page-object means that your every page is inherited from a base class which includes basic functionalities for every page. If you have some new functionalities that every page should have, you can simple add it to the base class. Base class is like the following: In this part we are creating pages which are inherited from base page. Every page has its own functionalities written as python functions. Some functions return to a new page, it means that these functions leave the current page and produce a new page. You should write as much as functions you need in the assertion part because this is the only part you can use the webdriver functions to interact with web pages . This part can be evaluate as providing data to assertion part.   The last part is related to asserting your test cases against to the

Mobile Test Automation: Appium with Python Client

Appium is an open source tool for mobile test automation, you can automate functional test cases for Android and iOS application. As in my some previous posts, I explained Calabash and I just used Ruby for writing test cases because Calabash only supports Ruby and as I know they have plan to support Java. However Appium doesn't have this language constriction. Since it uses Webdriver, it supports the languages which are supported by Webdriver. It means that Java, Objective-C, PHP, Python, C#, Clojure, Perl, JavaScript with Node.js and plus Ruby are supported. You just install the language client you want to test and then write your test cases. Check for the client for your favourite languages from Appium page . Install Appium: npm install -g appium Install Appium Client: npm install wd Install Python Appium Client: pip install Appium-Python-Client Ensure that you have Python installed, recommend to have 2.7 or above: python --version Ensure that you have

Creating Test Data: How to call Python Function from Java

For my testing purposes, I need to create an e-mail before running automated test cases so that it should used it for new registration and a new one for sending invitation to unregistered e-mail and there are some other test cases which use new e-mail for testing. I have create Python function which produce a new e-mail address in this format: gunesmess+1@gmail.com and next run it will create gunesmes+2@gmail.com and for every run, it creates a new one just increasing the last used e-mail number. You can use this file for your testing too. Just create numberRun.txt file in you directory. For my recent project, I need to write my automated test cases in Java so I have learnt some Java but not as professional. For this project again I need to create new unregistered e-mail address for using almost the same scenarios. Therefore I needed to call Python function in my Java code, instead of writing it in Java. The following code is used for calling: What you need is that you m

How to Update Selenium Webdriver for Windows

As I tried to explain in my previous posts Selenium is an automation framework for web application and Webdriver is the newer version of Selenium RC. I have used Selenium Webdriver for automatizing web application with version of selenium-2.25.0-py2.7.egg which prepared for the Python. However there are newer version this Webdriver package.In this post I explain how to update Webdriver version on Windows. If you check the site-packages folder where the Webdriver installation folders are present, you can see the related folder. In this folder there is easy_install.py which is used upgrading. If you can't find this file first you need you install setuptool . To update the Selenium version, you can follow the instruction below: Check easy_install file in the directory like as C:\Python27\Lib\site-packages if there is easy_install go to next step, if you don't have it install setuptools from here. Download Selenium newer version from here . Select the link what language

Selenium drop-down seçimi

Eğer web teknolojileri üzerine geliştirme yapıyor iseniz Selenium'u mutlaka duymuşşunuz. Kısaca selenium browser üzerinde test otomasyonu yapmaya yarayan bir firefox eklentisidir. İyi kullanıldığında etkili sonuçlar verir. Ücretsiz, farklı browserlarda da kullanılması, bol miktarda bilgi birikimi (dokümantayon, web sayfası ve blog) olması ve farklı dillerde test caseleri yazmaya olanak sağlaması ise avantajlarıdır.  Selenium'da script dilini Python seçildiğinde oto kayıt drop-down menüsünden bir seçenek seçildiğinde çoğu zaman alltaki gibi Select fonksiyonu içerisinde web objelerinde arayacağı fonksiyonu yazar ve görülebilen secenekler üzerinde arama yapar. Select(driver.find_element_by_id("id_promotion")).select_by_visible_text("OPTION") Fakat bu satırı çalıştırdığınızda aşağıdaki gibi bir Select komutunun tanımlanmadığı ile ilgili bir hata ile karşılaşırsınız: NameError: global name 'Select' is not defined File "D:\automatio