Archive

Archive for the ‘Uncategorized’ Category

Crop center and resize paperclip image attachment

has_attached_file :profile_image,
storage: :s3,
s3_credentials: {
bucket: Settings.s3_bucket_name,
access_key_id: Settings.aws_access_key_id,
secret_access_key: Settings.aws_secret_access_key
},
default_url: '/assets/default_profile_pic.png',
styles: { square_50: '', square_100: '', square_193: '' },
convert_options: {
square_50: '-gravity center -resize 50x50^ -crop 50x50+0+0',
square_100: '-gravity center -resize 100x100^ -crop 100x100+0+0',
square_193: '-gravity center -resize 193x193^ -crop 193x193+0+0'
}

Categories: Uncategorized Tags: , , ,

Date Time Format In RUBY

November 27, 2012 1 comment

Format meaning:

%a – The abbreviated weekday name (“Sun”)
%A – The full weekday name (“Sunday”)
%b – The abbreviated month name (“Jan”)
%B – The full month name (“January”)
%c – The preferred local date and time representation
%d – Day of the month (01..31)
%H – Hour of the day, 24-hour clock (00..23)
%I – Hour of the day, 12-hour clock (01..12)
%j – Day of the year (001..366)
%m – Month of the year (01..12)
%M – Minute of the hour (00..59)
%p – Meridian indicator (“AM” or “PM”)
%S – Second of the minute (00..60)
%U – Week number of the current year,
starting with the first Sunday as the first
day of the first week (00..53)
%W – Week number of the current year,
starting with the first Monday as the first
day of the first week (00..53)
%w – Day of the week (Sunday is 0, 0..6)
%x – Preferred representation for the date alone, no time
%X – Preferred representation for the time alone, no date
%y – Year without a century (00..99)
%Y – Year with century
%Z – Time zone name
%% – Literal “%” character

t = Time.now
t.strftime(“Printed on %m/%d/%Y”) #=> “Printed on 27/11/2012”
t.strftime(“at %I:%M%p”) #=> “at 11:06AM”

Categories: Uncategorized Tags:

Disable Firewall CentOS / RHEL / RedHat

September 18, 2012 2 comments

First login as the root user.

Next enter the following three commands to disable firewall.
# service iptables save
# service iptables stop
# chkconfig iptables off

If you are using IPv6 firewall, enter:
# service ip6tables save
# service ip6tables stop
# chkconfig ip6tables off

Categories: Uncategorized Tags: ,

Selenium Webdriver with Ruby Unit Example of Google Search

Copy the code and save as google_search.rb and run “ruby google_search.rb”

require “selenium-webdriver”
require “test/unit”
class GoogleSearch < Test::Unit::TestCase
  def setup
    @driver = Selenium::WebDriver.for :firefox
    @base_url = “http://www.google.com/&#8221;
    @driver.manage.timeouts.implicit_wait = 30
    @verification_errors = []
  end
  def teardown
    @driver.quit
    assert_equal [], @verification_errors
  end
  def test_google_search
    @driver.get(@base_url)
    @driver.find_element(:name, “q”).clear
    @driver.find_element(:name, “q”).send_keys “Thiyagarajan Veluchamy”
    @driver.find_element(:name, “btnK”).click
  end
  def element_present?(how, what)
    @driver.find_element(how, what)
    true
  rescue Selenium::WebDriver::Error::NoSuchElementError
    false
  end
  def verify(&blk)
    yield
  rescue Test::Unit::AssertionFailedError => ex
    @verification_errors << ex
  end
end
Categories: Uncategorized Tags:

sendmail settings in rails 3 application

Open “application.rb” file in “config” folder of your application and add the following data to it.

*************************************************************

config.action_mailer.delivery_method = :sendmail

config.action_mailer.sendmail_settings = {
:location => ‘/usr/sbin/sendmail’,
:arguments => ‘-i -t’
}

config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

*************************************************************

Categories: Uncategorized Tags: ,

Taskbar missing in ubuntu

  1. Press Alt+F2, in text fild type ‘gnome-terminal’ (without quots) and click on ‘Run’.
  2. In terminal submit the commands below one by one. Select one line at a time and press ‘Enter’.

gconftool –recursive-unset /apps/panel
rm -rf ~/.gconf/apps/panel
pkill gnome-panel

Categories: Uncategorized Tags:

Preload site before displaying

We can easiest can do this,

<html>
<head>
<script language="javascript" type="text/javascript">
function showpage() {
 document.getElementById('loader').style.display = "none"; 
 document.getElementById('main').style.display = "block"; 
}
</script>
</head>
<body onload="showpage();">
<div style="height:100%; width:100%; display:block;" id="loader">
Some preloading content here
</div>
<div style="height:100%; width:100%; display:none;" id="main">
Main Content Here
</div>

</body>
</html>
Categories: Uncategorized

assert vs verify in selenium

Assert –

When test case fail immediately test get aborted.

Verify – 

Will generate failure log after complete the test execution. 

Assert Commands –

  • assertAlert(pattern)

Verify Commands –

  • verifyAlert(pattern)
Categories: Uncategorized

Mobile Application Testing Interview Questions

  1. What is the difference between Mobile Testing and Mobile Application Testing ?
  2. What is your approach while Testing Mobile Applications?
  3. Have you ever written a Test Plan?What are the things specific to Mobile Application would you emphasis on while writing test plan for Mobile Applications?
  4. Do you know Facebook?Tell me what are the High level test cases for Facebook Web Application and for Facebook Mobile Application?
  5. Can you please let me know,the devices you have worked upon?
  6. Testing of Mobile Application on Emulators.Can you let me know your view?
  7. Have you ever worked on any automation tool for Testing Mobile Application?
  8. Please tell me about your project.What kind of Mobile Applications have you worked upon?
  9. Do you have Idea about Mobile Operating Systems?
  10. Blackberry Devices have which Operating system?
  11. What is current iOS (iphone OS) version?
  12. You have two cases. 1st you can not disconnect your call and 2nd you can not send SMS from your devices.Tell me Severity and Priority in both the cases?
  13. What are different Mobile Platforms/OS?
  14. What are the different way you can install a Mobile Application?
  15. Have you ever worked on Device Anywhere?Do you have experience of working on it?
  16. Do you have Idea about application certification program like True Brew Testing(TBT),Symbian Signed Test Criteria,Java Verified Program?
  17. See this application(Interviewer is given a Handset with a Mobile Application installed).Tell me what are the bugs in this Mobile application/Game.?
  18. Have you ever worked on LBS Application ?
  19. How will you test a Location Based Mobile Application?
  20. How will you perform Performance Testing for a Mobile Application?

Web apps Functional Testing Checklist

1. FUNCTIONALITY

1.1 LINKS

1.1.1 Check that the link takes you to the page it said it would.
1.1.2 Ensure to have no orphan pages (a page that has no links to it)
1.1.3 Check all of your links to other websites
1.1.4 Are all referenced web sites or email addresses hyperlinked?

1.1.5 If we have removed some of the pages from our own site, set up a custom 404 page that redirects your visitors to your home page (or a search page) when the user try to access a page that no longer exists.
1.1.6 Check all mailto links and whether it reaches properly

1.2 FORMS

1.2.1 Acceptance of invalid input
1.2.2 Optional versus mandatory fields
1.2.3 Input longer than field allows
1.2.4 Radio buttons
1.2.5 Default values on page load/reload(Also terms and conditions should be disabled)
1.2.6 Is Command Button can be used for HyperLinks and Continue Links ?
1.2.6 Is all the datas inside combo/list box are arranged in chronolgical order?
1.2.7 Are all of the parts of a table or form present? Correctly laid out? Can you confirm that selected texts are in the “right place?
1.2.8 Does a scrollbar appear if required?

1.3 DATA VERIFICATION AND VALIDATION

1.3.1 Is the Privacy Policy clearly defined and available for user access?
1.3.2 At no point of time the system should behave awkwardly when an invalid data is fed
1.3.3 Check to see what happens if a user deletes cookies while in site
1.3.4 Check to see what happens if a user deletes cookies after visiting a site

2. APPLICATION SPECIFIC FUNCTIONAL REQUIREMENTS

2.1 DATA INTEGRATION

2.1.1 Check the maximum field lengths to ensure that there are no truncated characters?
2.1.2 If numeric fields accept negative values can these be stored correctly on the database and does it make sense for the field to accept negative numbers?
2.1.3 If a particular set of data is saved to the database check that each value gets saved fully to the database. (i.e.) Beware of truncation (of strings) and rounding of numeric values.

2.2 DATE FIELD CHECKS

2.2.1 Assure that leap years are validated correctly & do not cause errors/miscalculations.
2.2.2 Assure that Feb. 28, 29, 30 are validated correctly & do not cause errors/ miscalculations.
2.2.3 Is copyright for all the sites includes Yahoo co-branded sites are updated

2.3 NUMERIC FIELDS

2.3.1 Assure that lowest and highest values are handled correctly.
2.3.2 Assure that numeric fields with a blank in position 1 are processed or reported as an error.
2.3.3 Assure that fields with a blank in the last position are processed or reported as an error an error.
2.3.4 Assure that both + and – values are correctly processed.
2.3.5 Assure that division by zero does not occur.
2.3.6 Include value zero in all calculations.
2.3.7 Assure that upper and lower values in ranges are handled correctly. (Using BVA)

2.4 ALPHANUMERIC FIELD CHECKS

2.4.1 Use blank and non-blank data.
2.4.2 Include lowest and highest values.
2.4.3 Include invalid characters & symbols.
2.4.4 Include valid characters.
2.4.5 Include data items with first position blank.
2.4.6 Include data items with last position blank.

 

Categories: Uncategorized

Selenium ( web application testing system )

The selenium is one off the most popular free web based automation tool. The following steps will help to install(firefox),

1. go to “http://seleniumhq.org/download/&#8221;
2. download “Selenium IDE”
3. execute the downloaded file
4. click install now

Now ready after restart the FireFox browser.

Categories: Uncategorized

First Name, Last Name Validation

It should be

– first and last character must be alphabet

– accepts single character input

–  it wont allow any special character and white space at start and end

Categories: Uncategorized Tags:

Priority Testing

Generally Priority is Business for the projects.  And this will be set by the team lead or the project lead, based on the severity and the time constraint that the module has the priority will be set.

  1. Must fix the bug as soon as possible. Because bug is blocking further progress in this area.
  2. Should fix the all issues, before release the product or project.
  3. fix the issues within time period.
Categories: Uncategorized

Available Browsers for Linux, Windows, Mac for Testing

A Web browser is a software application, user to display and interact with text, images, music, videos, games & etc typically located on a Web page at a Web site on the World Wide Web or a local area network. A web browser is importing for web application testing … The great number of browsers in the internet,

Web browsers listing for Windows

Logo Browser Name & Developed by
Internet Explorer logo Internet Explorer
Microsoft Corporation
Download version 7 & 8
Firefox (also called Mozilla Firefox) logo Mozilla Firefox
Mozilla Corporation
Download latest version
Chrome logo Chrome
Google
Download Chrome
Safari logo Safari
Apple Inc.
Download version 4 Beta
Opera logo Opera
Opera Software ASA
Download version 9.64
Netscape Navigator logo Netscape Navigator
AOL
Download version 9
SeaMonkey logo SeaMonkey
Mozilla Foundation
Download version 1.1.15
K-Meleon logo K-Meleon
kmeleonbrowser.org
Download version 1.5.2
Amaya logo Amaya
W3C
Download version 11.1
Maxthon Browser logo Maxthon Browser
Maxthon
Download version 2.5.1
Flock (web browser) logo Flock
Flock, Inc.
Download version 2
Slim Browser logo Slim Browser
FlashPeak
Download version 4.11
KidRocket logo KidRocket
KidRocket.org
Download version 1.5
PhaseOut web browser logo PhaseOut
PhaseOut
Download latest version
Crazy Browser logo Crazy
Crazy Browser
Download version 3
Smart Bro logo Smart Bro
Mind Vision Software
Download latest version
ShenzBrowser logo ShenzBrowser
Shenz International
Download version 1.1
JonDoFox logo JonDoFox
JonDoNYM
Download version 2.1.3
Avant Browser logo Avant Browser
Avant Force
Download version 11.7
xB Browser logo xB Browser
XeroBank
Download version 2.9.1.2
Sleipnir  logo Sleipnir
Fenrir Inc.
Download version 2.8.3
space time logo space time
space time
Download version 1
Browse3D logo Browse3D
Browse3D Corporation
Download version 3.5
3B Room logo 3B Room
3B
Download version 3.11
Bitty Browser logo Bitty Browser
Turnstyle
Download version
Grail logo Grail
CNRI
Download version 0.6
Lynx logo Lynx
Thomas Dickey
Download version 2.8.6
Happy Browser logo Happy Browser
Igoodsoft Software
Download version 1.03

How To Access Blocked Web Sites

i given blow more proxy sites:

  1. http://www.hidemyass.com
  2. http://www.anonymizer.com
  3. http://www.wujie.net
  4. http://www.ultrareach.net
  5. http://surfshield.net
  6. http://www.guardster.com/subscription/proxy_free.php
  7. http://anonymouse.ws/anonwww.html
  8. http://www.browser-x.com
  9. http://www.spysurfing.com
  10. http://www.xerohour.org/hideme
  11. http://www.proxyz.be
  12. http://www.sc0rian.com/prox
  13. https://www.proxify.us
  14. http://kproxy.com/index.jsp
  15. http://www.brawl-hall.com/pages/proxy.php
  16. http://www.proxify.net
  17. http://proxy.computersteroids.com/index0.php
  18. http://www.unipeak.com
  19. http://flyproxy.com
  20. http://alienproxy.com
  21. http://proxify.com/
  22. http://www.unfilter.net
  23. http://www.proxymouse.com
  24. http://www.surfonym.com/cgi-bin/nph-proxy
  25. http://www.superproxy.be/browse.pl
  26. http://www.websiteguru.com/mrnewguy
  27. http://www.letsproxy.com
  28. http://www.fsurf.com
  29. http://indianproxy.com
  30. http://www.letmeby.com
  31. http://Boredatschool.net
  32. http://www.ibypass.org
  33. http://www.ipzap.com/
  34. https://proxify.biz
  35. http://kproxy.com/index.jsp
  36. http://www.attackcensorship.com/attack-censorship.html
  37. http://mrnewguy.com
  38. http://www.evilsprouts.co.uk/defilter
  39. http://www.proxify.info
  40. http://www.torify.com
  41. http://www.switchproxy.com
  42. http://www.proxifree.com
  43. http://www.secure-tunnel.com/
  44. http://www.proxify.cn
  45. http://www.arnit.net/utilities/webproxy/new
  46. http://www.proxify.co.uk
  47. http://www.betaproxy.com
  48. http://www.proxify.org
  49. http://www.proxychoice.com
  50. http://www.proxysnail.com
  51. http://www.anonypost.com
  52. http://www.thestrongestlinks.com
  53. http://www.hujiko.com
  54. http://www.anonproxy.info
  55. http://www.peoplesproxy.com
  56. http://www.freeproxy.us
  57. http://www.proxyweb.net
  58. http://www.nopath.com
  59. http://urlencoded.com
  60. http://www.pole.ws
  61. http://www.browseany.com
  62. http://www.spiderproxy.com
  63. http://www.clickcop.com
  64. http://www.sneakysurf.com
  65. http://www.mywebtunnel.com
  66. http://www.thewebtunnel.com
  67. http://www.3proxy.com
  68. http://www.yourfreeproxy.com
  69. http://www.proxy7.com
  70. http://www.fireprox.com
  71. http://www.stupidcensorship.com
  72. http://www.letsproxy.com
  73. http://www.sneak2.com
  74. http://www.cecid.com
  75. http://www.freeproxy.ca
  76. http://www.ibypass.org
  77. http://www.goproxing.com
  78. http://www.projectbypass.com/
  79. http://www.ipsecret.com
  80. http://www.nomorelimits.net
  81. http://www.proxify.de
  82. http://www.bywhat.com
  83. http://www.snoopblocker.com
  84. http://www.anonymizer.ru
  85. http://www.proxyking.net/
  86. http://www.perlproxy.com
  87. http://www.proxylord.com
  88. http://tntproxy.com
  89. http://satanproxy.com
  90. http://zombieinvasion.info
  91. http://demonproxy.com
  92. http://www.myfreeproxy.com
  93. http://www.gezcem.com/nph-proxy.pl.old
  94. http://mpleger.de
  95. http://www.the-cloak.com/login.html
Categories: Uncategorized Tags:

Top 25 common programming bugs

Insecure Interaction between Components

  1. Improper Input Validation
  2. Improper Encoding or Escaping of Output
  3. Failure to Preserve SQL Query Structure (‘SQL Injection’)
  4. Failure to Preserve Web Page Structure (‘Cross-site Scripting’)
  5. Failure to Preserve OS Command Structure (‘OS Command Injection’)
  6. Clear text Transmission of Sensitive Information
  7. Cross-Site Request Forgery (CSRF) 8. Race Condition
  8. Error Message Information Leak

Risky Resource Management

  1. Failure to Constrain Operations within the Bounds of a Memory Buffer
  2. External Control of Critical State Data
  3. External Control of File Name or Path
  4. Un trusted Search Path
  5. Failure to Control Generation of Code (‘Code Injection’)
  6. Download of Code Without Integrity Check
  7. Improper Resource Shutdown or Release
  8. Improper Initialization
  9. Incorrect Calculation

Porous Defenses

  1. Improper Access Control (Authorization)
  2. Use of a Broken or Risky Cryptographic Algorithm
  3. Hard-Coded Password
  4. Insecure Permission Assignment for Critical Resource
  5. Use of Insufficiently Random Values
  6. Execution with Unnecessary Privileges
  7. Client-Side Enforcement of Server-Side Security