Saturday, May 18, 2013

Tips and Tricks

TIP 1 : Not able to install gem

In case you are facing issues installing gems. You may need to install Development Kit

Install Development Kit
=================
1. Download DevKit from - http://rubyinstaller.org/downloads/

Several and different versions of Development Kits (DevKit) are listed. Please download the right one for your version of Ruby:
  • Ruby 1.8.6 to 1.9.3: tdm-32-4.5.2
  • Ruby 2.0.0: mingw64-32-4.7.2
2. Create a folder C:\DevKit  and Save the file tdm-32-4.5.2

3. Run tdm-32-4.5.2.exe to extract the files to folder C:\DevKit

4. Using Command Prompt Navigate to C:\DevKit
Run the command ruby dk.rb init

  It will generate the config.yml file to be used later in this Step. Your installed Rubies will be listed there (only those installed by a RubyInstaller package are detected at present).

*** edit the generated config.yml file to include installed Rubies not automatically discovered or remove Rubies you do not want to use the DevKit with.***

**** [optional] ruby dk.rb review to review the list of Rubies to be enhanced to use the DevKit and verify the changes you made to it are correct.****

5. Finally, Install DevKit to enhance your installed Rubies
Run the command ruby dk.rb install

[Now try installing any gems it should work seamlessly] 

**********

TIP 2 : No connected devices (Run time Error)

Make sure you have the emulator running (or restart the emulator).


**********

TIP 3 : Data Driven Testing Using Cucumber

Try Scenario Outline using Examples

Scenario Outline: Login
  Given I am on login page
  When I enter username <username> and password <password> and press login
  Then I get redirected to <redirect_page>

Examples:
  | username | password | redirect_page     |
  | "Jonas"  | "secret" | "Jonas Home Page" |
  | "Anna"   | "Data"   | "Annas Home Page" |

**********


5 comments:

  1. Thanks Amit - Really Very Helpfull !!

    ReplyDelete
  2. Ya really helpfull, but i am not getting how to write the code in step definitions for the above examples.
    Can anyone please give me an idea on this

    ReplyDelete
  3. Where to write if loops in code ... is it like we need to write it in step def or we have to use it only in hooks.rb

    ReplyDelete
  4. NO CONNECTED DEVICES (RUN TIME ERROR). I am getting this error when I try to run the test using avd. Any solution to manage it from command line itself. Since I am running the test on docker I cannot depend of adb.

    ReplyDelete
  5. NO CONNECTED DEVICES (RUN TIME ERROR). I am getting this error when I try to run the test using avd. Any solution to manage it from command line itself. Since I am running the test on docker I cannot depend of adb.

    ReplyDelete