Skip to main content

Posts

Showing posts with the label Automation

SQLCMD: Alternative Way of Working with Microsoft SQL Database for Ruby

If you have Microsoft SQL server in your test environment and want to populate test data in Capybara, Calabash scripts you will most probably have difficult time to installing appropriate Ruby gems. One of most popular ruby gem for Mssql connection is tiny_tds but I was not able to install it for both Windows and Unix like environment just because of dependencies. I got the following errors: Errno::EACCES: Permission denied @ rb_sysopen - /Users/mesutgunes/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/.codeclimate.yml An error occurred while installing tiny_tds (1.1.0), and Bundler cannot continue. Make sure that `gem install tiny_tds -v '1.1.0'` succeeds before bundling. Another popular ruby gem is sequel . It does not give an error for installation but when it comes to usage, it gives the following error for not found adapter. Main problem with the Mssql in unix is finding compatible adapter. See the log: irb#1(main):002:0> db = Sequel.odbc(&qu

Appium vs Calabash

If you want to test your mobile application and looking for an open source testing tools then most probably you will face Calabash and Appium . These are the top two most popular tools for mobile automation. At first glance, they seem to be learnt easily but in detail you would have to deal with many challenges and must spend little bit longer time than you expected. Since these tools are open-sourced and still not mature level of quality there would be some problems when you want to use them for your special needs.  In this post I want to write down my experience about Calabash and Appium. This post may help you to choose which one is suitable for your needs. I used following versions: Calabash-Android: 0.7.3 Calabash-iOS: 0.19.1 Appium: 1.5.2 Appium Support Many Languages But Calabash is RUBY! In the background Appium uses Selenium which was created 14 year ago by Thougthwork, check thoughts about Selenium  for mobile testing by Thougthwork. Since Selenium supports Ja

Change Default Timeout and Wait Time of Capybara

One of the biggest challenge for automation is handling timeout problem. Most of the time, timeout is 60 seconds but it may sometimes not enough if you have badly designed asynchronous calls or the third party ajax calls. This makes handling timeout more complex. set large enough to tolerate network related problems. For Selenium based automation frameworks, like Capybara, default Webdriver timeout is set to Net::ReadTimeout (Net::ReadTimeout) Changing ReadTimeout If you have timeout problem for Capybara, it gives an error like above. This means that the page is not fully loaded in given timeout period. Even you can see that page is loaded correctly but webdriver wait until the Ajax calls finish. class BufferedIO #:nodoc: internal use only def initialize (io) @io = io @read_timeout = 60 @continue_timeout = nil @debug_output = nil @rbuf = '' end . . . . . def rbuf_fill beg

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

Selenium Chromedriver Error Message: u'unknown error: unable to discover open pages

If you use selenium webdriver to automate regression test cases, you may have got the following error. Because a bug in chromedriver version 2.3 causes this error. According to Google Dev ., this problem had fixed in version 2.6.  Assigning the chrome driver to driver leads to this error by the line 38, which is self.driver = webdriver.Chrome() . To solve the problem, you need to change the chromedriver version 2.3 in your execution path, like C:\Windows\System32 under Windows, with newer version. You can download chrome driver from googleapis .   Error message may like this: Traceback (most recent call last):   File "D:\workspace\automation_project\run.py", line 32, in <module>     m = Project(browser, server)   File "D:\workspace\automation_project\test_case_imps.py", line 38, in __init__     self.driver = webdriver.Chrome()   File "C:\Python27\lib\site-packages\selenium-2.35.0-py2.7.egg\selenium\webdriver\chrome\webdriver.py", line

Selenium Error Message: "Can't load the profile. Profile Dir:..."

Because of an upgrade, I needed to move to new computer and new operation system so I moved my automation code to new system which is from Window 7 to Windows 8. When run the code I got the following error indicating that the Selenium can't load the profile which means that the version of the browser is not supported by the Selenium yet. If you get an error like the following one, you need to find the supported version of the browsers. Traceback (most recent call last):   File "D:\workspace\ automation_project \run_test_cases.py", line 12 4, in <module>     m = Markafoni(browser, server)   File "D:\workspace\ automation_project \test_case.py", line 8 64, in __init__     self.driver = webdriver.Firefox()   File "C:\Python27\lib\site-packages\selenium-2.25.0-py2.7.egg\selenium\webdriver\firefox\webdriver.py", line 51, in __init__     self.binary, timeout),   File "C:\Python27\lib\site-packages\selenium-2.25.0-py2.7.egg\sele

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