Monday, July 6, 2015

Web Services Interview Question

What is WSDL ?

What is the difference between SOAP and Rest ?

Explain what assertion is in Soap UI ?

In SOAP UI assertion functionality is used to validate the response of request received by the Test Steps at the time of execution.  It is used to compare a part of message to some expected value.

Assertion types in SOAPUI includes

Simple contains
Schema compliance
Simple not contains
Soap Faults
Response SLA
XPath Match
XQuery Match
WS security status
Script Assertion
WS- Addressing Request or Response Assertion

SQL Interview Question

What is the difference between “delete” , “truncate” and “drop” commands

What is the syntax for writing insert queries

What are DDL and DML commands

What is the difference between sub queries and joins

Sub Queries : To write sub queries between two or more tables, there is no need to be relation exist among those tables

Joins: To write joins between two or more tables, there should be relation exist among those tables

Tuesday, June 23, 2015

Forward and Backward Navigation

Click here to get Java Snippet for this script.

__author__ = 'Gaurav.Khanna'

from selenium import webdriver

# Initializing FireFox Driver
webDriver = webdriver.Firefox()

# Assigning URL to variable 'baseUrl'
baseUrl = "http://book.theautomatedtester.co.uk"

# Open the link
webDriver.get("http://book.theautomatedtester.co.uk")

# Maximize browser window
webDriver.maximize_window()

# Click on link
webDriver.find_element_by_link_text("Chapter1").click()

# Print Page Title
print(" Page Title : " + webDriver.title)

# Using Back Method
webDriver.back()

# Print Page Title
print(" Page Title : " + webDriver.title)

# Using Forward Method
webDriver.forward()

# Print Page Title
print(" Page Title : " + webDriver.title)

# This will close the browser
webDriver.quit()

File Uploading

Click here to get Java Snippet for this script.

__author__ = 'Gaurav.Khanna'

from selenium import  webdriver

# Initializing FireFox Driver
webDriver = webdriver.Firefox()

# Assigning URL to variable 'baseUrl'
baseUrl = "http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_FILE.html"

# Open the link
webDriver.get(baseUrl)

# Maximize browser window
webDriver.maximize_window()

# Upload File
webDriver.find_element_by_name("upfile").send_keys("C:\\gaurav\\gaurav.txt")

# Click on Submit Button
webDriver.find_element_by_xpath("//input[@value='Submit']").click()

#This will close the browser
webDriver.quit()

Extracting Links from Web Page

Click here to get Java Snippet for this script.

__author__ = 'Gaurav.Khanna'

from selenium import webdriver

# Initializing FireFox Driver
webDriver = webdriver.Firefox()

# Open URL
webDriver.get("http://not-just-a-tester.blogspot.in/")

# Find all anchor tags
allLinks = webDriver.find_elements_by_tag_name("a")

# Print All Links
for links in allLinks:
    print(links.get_attribute('href'))
    print("\n")

# Close Browser
webDriver.close()