Skip to content
March 16, 2012

Testing Experience – the Magazine for professional testers

Testing Experience – the Magazine for professional testers


March 16, 2012

Agile Testing: How to Succeed in an Extreme Testing Environment by John Watkins

Agile Testing: How to Succeed in an Extreme Testing Environment


March 16, 2012

Creating test framefork using PowerShell

Sometimes you need to test using PowerShell. The first thing to create assertion function. Below an example of implementation:

function Assert-Equals(
  $expected     = $(throw "Please, specify the expected object"),
  $actual     = $(throw "Please, specify the actual object"),
  [string] $message = "Assertion failed." )
{
  if(-not ($expected -eq $actual))
  {
    throw "FAIL.  Expected: $expected.  Actual: $actual.  $message"
  }
}

To be continued…

March 5, 2012

Selenium Web Driver: some tricks using Python

After migrating to Web Driver it took time to get with the following things:

* Selecting element from drop down list (now not just select command), e.g.:

el = driver.find_element_by_id('id_line')
for option in el.find_elements_by_tag_name('option'):
    if option.text == "line to select":
        option.click()
        break

* If there are lot of element existence checks that wrapped in try-catch block it is useful to reduce implicit timeout to reduce overall test execution time, e.g. for Firefox driver:

def setUp(self):
    self.driver = webdriver.Firefox()
    self.driver.implicitly_wait(5)
    self.verificationErrors = []

* Try to avoid time.sleep(N) commands in tests it is better to wait for some action or change in system. So the best way to make construction:


try:
    if self.is_element_present(By.CSS_SELECTOR, "h3 > strong"):
        driver.find_element_by_link_text("169_convertedvideo_425").click()
        self.assertTrue(int(driver.find_elements_by_css_selector("#video_source span.black")[0].text) >= 0)
    else:
        raise Exception(self.id() + ".ErrorText!")
except Exception as e: self.verificationErrors.append(str(e))
finally:
    self.removeAllMonitoringSources(driver)

or wait by small ticks:


for i in range(60):
    try:
        if self.is_element_present(By.LINK_TEXT, "Exit"): break
    except: pass

    time.sleep(1)

else: self.fail("time out")

* Xpath is always slower in IE
* If some elements in DOM are hidden you can access them using JavaScript execution command driver.execute_script(script, *args)

November 15, 2011

Windows: Installing Python and Selenium

Python logo

Image via Wikipedia

To install Python and Selenium you need to follow the list bellow:

Read more…

October 21, 2011

XSS: Pay attention to input validation

“Experience shows that test cases that explore boundary conditions

have a higher payoff than test cases that do not.”

The art of software testing. Glenford J. Myers

Recently I was asked to look through a website to find undetected bugs with fresh pair of eyes.

First of all I decided to pay attention to boundary value analysis and I was rewarded. Since there were plenty of forms on pages it was detected:

  • in the most inputs there were no boundary check (one could put value of any length that caused SQL error)
  • no input data validation (phone number format, e-mail format, incorrect values and so on)
  • and the most harmful was XSS

Read more…

Follow

Get every new post delivered to your Inbox.