Professional Documents
Culture Documents
robotframework
*** Variables ***
${BROWSER} firefox
${URL} http://url/
${Delay} 0
in my settings.txt file i have a variable named {BROWSER} AND associate
value as shown above it is firefox
PS: this is in settings.txt file and i have two folders in which i have
test.txt files. so there is the main problem ..i have to iterate these folders
in a loop
|-- main.py
|-- settings.txt //in this file i have browser variable (or Array)
|-- test1
| |-- testl.txt
| |-- test1_settings.txt //this will contain all the variables and user defined keyword
related to test1 and
|-- test2
| |-- test2.txt
| |-- test2_settings.txt //same as test1
i run test cases like this $pybot test1 test2
1) loop over your browser and call a keyword that do your test:
[Mac]$ pybot .
Browser.Ts
======================================================================
========
test with several browser
call keyword that does your test with firefox
call keyword that does your test with chrome
call keyword that does your test with IE
test with several browser | PASS |
------------------------------------------------------------------------------
Browser.Ts | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
======================================================================
========
2) another way (which I prefer) is to keep your ${BROWSER} variable with
a single value and call your test case several time with a new value for
the variable that you give on the command line:
I Just wrote a program which will read the file settings.txt and find the
line @{BROWSER} firefox chrome IE and then extract browsers name and
store into a list . so this script will return a List something like this
['firefox', 'chrome', 'IE']
now instead of using single pybot command I'll use it in a Loop
${BROWSER} firefox #So default browser is firefox. you can leave it blank
@{BROWSERS} firefox chrome IE
Q #2) What all things can you automate?
The right candidates for automation are:
Q #8) What is a framework?
A framework is a set of a structure of the entire automation suit. It is also a guideline if
followed can result in a structure which is easy to maintain and enhance. These guidelines
include:
Coding standards
Handling the test data
Maintaining and handling the elements (object repository in QTP)
Handling of environment files and properties file
Reporting of data
Handling logs
Q #9) What are the attributes of a good framework?
The characteristics are:
Q #11) What are the different types of automation tool you are aware of?
Open source tool like Selenium, JMeter
Paid tools like QTP, Load Runner, Ranorex, RFT, and Rational Robot.
Q #14) Why do you want to keep this kind of information in a separate file and not
directly in code?
URL, Login, and passwords are the kind of fields which are used very often and these
changes as per the environment and authorization. In case we hardcode it into our code, we
have to change it in every file which has its reference. In case there are say more than 100
files, then it becomes very difficult to change in all the 100 files and hence can lead to
errors. So this kind of information is maintained in a separate file so that updating becomes
easy.
Q #19) How do you select which automation tool is best suited for you?
Selecting the automation tool depends upon various factors like:
Conclusion:
Most of the test automation interview questions are centered on the framework you
develop, so it is recommended that you create and understand your test framework
thoroughly. When I am interviewing, and the candidate has answered my question on the
framework, I also prefer asking language specific question (core java in my case).
The questions start from basics of java to write the logic of some basic scenario like –
In one of the interviews, I had attended for this profile. Below, were being asked (Had
mentioned it my resume, that I am having an experience of ~2 years on Selenium)
Note: I will write it as ‘general topic’ as I do not remember much on the exact questions
being asked
I have written based on my experience in an interview. Could not recollect the exact
questions being posed to me, Hence wrote it as general topic they covered.
Explore what make 52% of test project managers fail in executing their automation
testing projects.
@BeforeMethod, @AfterMethod
It is used to find the WebElement in web page. It is very useful to identify the dynamic web
elements.
There are 8 types of locators and all are the static methods of the By class.
• http://By. id ()
• http://By .name ()
• By.tagName ()
• By.className ()
• By.linkText ()
• By.partialLinkText ()
• By.xpath
• By.cssSelector ()
Assert it is used to verify the result. If the test case fails then it will stop the execution of the
test case there itself and move the control to other test case.
Verify it is also used to verify the result. If the test case fails then it will not stop the
execution of that test case.
Use submit () method but it can be used only when attribute type=submit.
If the return value of this method is true then it is checked else it is not.
Syntax:
act.moveToElement(WebElement).perform();
WebElement source = driver.findElement (By.xpath (“”)); //source ele which you want to
drag
WebElement target = driver.findElement (By.xpath (“”)); //target where you want to drop
act.dragAndDrop(source, target).perform();
Hi ,
Below are the questions that are generally asked during interviews in any automation
testing company to someone who has around 2 years experience in Automation testing
using selenium
There is ko specific set of questions that I can point to as it depends on the company and
the interviewer but still I will try to give few general topics you can prepare for before
attending any interview
If you need any help with any of the topic you can contact me I will be happy to help you.
Selenium
Selenium is one of the most popular automated testing suites. Selenium is designed in a
way to support and encourage automation testing of functional aspects of web-based
applications and a wide range of browsers and platforms. Due to its existence in the
open source community, it has become one of the most accepted tools amongst the
testing professionals.
Selenium is not just a single tool or a utility, rather a package of several testing tools and
for the same reason, it is referred to as a Suite. Each of these tools is designed to cater
different testing and test environment requirements.
This is regarding interview questions using selenium and Java in Delhi-Ncr
organizations
first of all questions would related to your current project, which framework
are you using & why, how & where you are initiating Driver, what is the
structure, draw the structure with block diagrams
How will you click on link inside a menu which is shown only when mouseis
hovered over it.
What is the difference between findelement and findelemets
What is the difference between implicit, explicit and fluent wait
How can you click on an element other than using the click function
How will you handle windows based popup
How will you take a screenshot
How will you read and write excel files
Scenario based questions on xpath, like how would you form the xpath of
this element-any scenario
Questions would be on your programming skills, like reverse a string, find
missing elements in an array
Questions would also be there on testNG, like what is dataprovider, what is
the order of execution of different methods, how would you exclude and
include different methods
If you are using Java, then questions coudl be on keywords like static, final,
finally, difference between abstract and interface, questions on collections like
difference between list and arraylist etc.
If you are using Maven and CI tools then questions might also be asked using
them.
I have been giving interviews from last 1 year and these are the questions which have
been asked mostly