Skip to main content

Posts

Showing posts with the label selenium

Selenium Assertion Check Fails if There are More Than Four Assertions

As you know that selenium is a open source test automation framework for web application. Since it has many good features and being free make it usable for anyone develops or tests web application. However, if we compare it with well-known, highly cost licensed product selenium has some disadvantages such as, as far as I used it may be the main problem, there is no guaranty if the automation scripts works all the time. Even it works for a run successfully, it may give error after a few seconds of it first run. Therefore to fully utilize it, the drawbacks of  the selenium should be known and the scripts should be redesigned. In this post, I want to explain a selenium experiment about assertion. Last time I have faced an error related assertion check during automating a new form. Error is related to a error message which can not be found by webdriver and it waits for a trigger to next step. However if I run every assertion one by one there is no error and it finished successfully. E

Integration of Two open Source Test Automaiton Tools: Watir and Selenium

Selenium and Watir Selenium and Watir are both open source and well-known automation tools. The power of Selenium is great but sometimes it may lead some insufficient result for executing test cases, or some difficulties can be achieved by Watir easily, surely or wise verse. Therefore we can use Selenium and Watir together for automating web applications. In this post, I want to show a sample to illustrate how to use both of them in the same automation framework. Possibly you maybe find something more accurate than what I did, fell free to post your thoughts. I have used Selenium with Pyhton as a base automation framework and call Watir in Ruby which Watir can be just only implemented by it. If you use another language than Python, you should use its features. In the sample, sign up for MYHABIT is implemented as Watir function in the name sign_up() and it is called by Selenium.  To call the Watir, Python module must import Popen, PIPE, STDOUT from Subprocess like as f

Using Selenium Webdriver via Internet Explorer (ie) and Chrome

As it is known Selenium IDE is an extention for Firefox browser. And the Webdriver is an application to send commands to firefox to drive it. As a default set-up, firefox comes with it for running automated test cases. However, sometimes running compatibiliy related test cases via, especially, Internet Explorer but Chrome may be needed. If you want to run your test cases via other browsers you need to do some configuration changes in your test environment. Download the webdriver of browsers for selenium web site: For Internet Explorer click here and dowload  IEDriverServer 32bit or 64bit depending on your system For Google Chrome, dowload Chronium webdriver click here   and dowload chromedriver_win Put the webdrivers to your path wich your executable files are present. It is generally like this C:\Windows\System32    You need to allow IE Driver and Chrome Driver to access your network: Allow Access to IE Driver and Chrome Driver Finally call the drivers you want to use

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

Quick starting to Selenium

Selenium IDE Selenium IDE is an open source test automation tool, actually a plug-in for firefox. Basically, it enables user to record a test case and replay it on firefox. However with the other features of selenium, more sophisticated works can be done by selenium. Following instructions can be followed for the installation and the use of Selenium IDE:          1. Install the latest version of Selenium IDE               > http://release.seleniumhq.org/selenium-ide/          2.  Open Selenium IDE               > Firefox > Tools >Selenium IDE          Selenium Remote Controller With the remote controller, written test scripts can be run on the different browsers. Test script can also be written in  C#, Java, PHP, Python ot Ruby so complex test cases can be written by desired programming language. Remote controller is a server prepared by Java so every time virtual apache server runs on the computer with the default port 4444. Following instructors can be