You are on page 1of 4

White spaces I mean the spaces like India is my country so India is there is a gap between India and east

and is my country so in each word that is a gap right so either I just don't want that gap and just remove
that gap so how can you implement this code OK so we can we can remove the white spaces from a
particular string there is there is a method called

Inside the string class we have one method replace all so based on the that method we can just replace
all the white spaces whatever present and with the with nothing OK so in this way we can remove the
white spaces so the program will be like a string STR and the the string value will be like India is my
country so in each word there is an A space right So what I can do is I will create one variable like string
no space string equals and whatever the object I have created for string like India is my country so string
dot replace all and inside the bracket we have a two we have to provide one is whatever the space is
there so for that we can use in double quotes 2 for backward slash and a small S so this denote that like
we are indicating for the space and the second one and then we have to use, and then in double quotes
we will write nothing and there is no space in between So what happened whatever the space will be
there that can be replaced by with nothing OK so this is the one where we can like remove all the white
spaces which were present in the particular

OK can you tell me the what is the difference between thread dot sleep and implicit way

The red dots and they replace it with both are act as invite only like but in thread dot sleep what
happened in this is a static grid and implicit rate is something which we we call it as a dynamic weight as
well in thread dot sleep what happened is whatever the seconds 30 seconds which we have provided for
a particular things to be with then what happened when the entire rate is over for like whatever the
millisecond wait like 5 millisecond weight I provided after that only whatever the operation will be there
that can be you know performed with the help of the red dot but in the implicit wait what happens
suppose I have provided the weight of 5 second and the the particular web page is loading and that
loaded the particular element within a three seconds So what happened within a three second your
execution will get done and it will move to the next command in your script so this this thing can be
achieved with the help of implicit wait but in thread dot sleep what happened it will just wait for wait for
entire 5 second and then only it will jump to the next command so we can say that the implicit rate
reduce the timing because well if the particular element whatever the element we want to you know
load that thing if it is loaded whatever the time we have provided before that only then it will be we can
say that it's a faster as compared to the red dot sleep right so yeah that is the difference like one is the
static and another insert dynamic

OK ohh can you tell me like I have to perform the right click operation OK so how how do I do that

So whatever the mouse and the keyboard events which we have to provide which we have to for that we
have a actions class so we the object of actions last when passing the driver reference what we have
created like web driver driver equals a new Chrome driver or Firefox driver so that driver instance we
have to provide and then like like the way we are locating the elements like where element element
equals driver dot find by element and based on by ID or maybe they expand we are going to find out the
element on the web page which we have to perform the right click operation right and then what we'll
do whatever the object we have created for actions class that object dot context click method is present
which will be helpful for clicking performing the right click operation OK for double click we have a
double click method and for right we have a a context click method so whatever the element we have
located that element needs to be passed inside the context click method and then dot perform it so in
this way like we can do the right click completion and suppose we have to perform more than one action
OK then we have to use a build dot perform for multiple operation needs to be performed together for
the action and if it is A1 single operation we have to perform then we can use the perform

Suppose I have one check box and I have to verify that like whether the checkbox is you know checked or
not so how how do I achieve it is there any way

Yes so we I we have to check like the check boxes displayed or not we have is selected method is there
which returns a boolean value like true or false right so based on that like we can check like if our
particular checkboxes are checked or not checked so for that first of all we have to locate that check box
area with the help of I mean the same way like from driver dot find by elements and whatever the value
we have to provide once we get that web comment then what we have to do that web element dot is
selected method is so that will give us the boolean value like if the checkbox is created I mean it is
checked then they will give us the true value and if it is not checked then it will give us the false so in this
way we can verify that like the check box is displayed or I'll check the OK let's move to do some
cucumber questions

Just basic I will ask yeah sure

Can you let me understand what is the purpose of step definition file in cucumber

Ohh yes sure so the the main purpose of this step definition file is like what happened is in step is in step
definition file in cucumber we used to segregate the feature file so we have a feature file so which is
written in a certain language so which is also called a shared language so in like feature file what
happened is we just write a normal English language where we have a the template or the pattern is like
one bin and then like this format is there which we write this scenarios and the test cases right so this
can be readable easily and even the non functional guy but the step definition file is exact exactly it is
whatever the given when and then is written so every step we can say that by each step of the feature
file that can be converted as an step definition method feature file and the given when and then this 4
lines are there so forgiven there is one method for when there is a one method in the step definition file
so the mapping of feature file and the we can say that step definition file are there so this is the main
purpose of like the step definition file So what happened whatever the things which is written in a
language is understandable by the business people easily but whatever the things written in the step
definition file that is written it like a programming languagelike.net Java or maybe the Ruby so that can
be understandable more on the test automation engineers right so so both the things are the same only
but what technical things are written in the step definition file and the basic and generic English
language we can say that and not English language but a normal layman a non-technical person can
easily understand what exactly this test case is doing based on reading the feature

So that is that is the main purpose of that definition

What is the real use cases of the behavior driven development methodology like in the in the real world
like why we use the BDD approach and

Uh yeah as I said like the behavior driven development is more a centric or we can say that like the
stakeholder than the clients and all those who are the non functional people those those who can you
know by reading those things or whatever the things return in the feature file that can be easily
understandable ohh by them that's why this like it's a simple text right so that can be easily
understandable by them so that's why this behavior driven development are like the most most of the
time we can use this I thought that involvement we can say that will be more like the business analysts
or the two way developers or the supporting everyone are like they they can give their contribution
more easily by understanding the way of the BD entirely BD works so that's why like the real new skills
we can see that of BD can you tell me what is the limit for maximum number of scenarios that can be
included maximum number of scenarios we can add in feature files so I guess there is no such hard rule
for like how many number of scenarios we can include in one feature file it is totally depend on the
project to project or maybe the organization level how they follow but the basic or maybe the advisable
option is to just limit the maximum 10 scenarios in one feature file

and and based on that you can work upon so yeah so it's it's just a general practice we can say that
where we can have a maximum of 10 scenarios in one feature file but yeah there's no hard rule for

what is the use of example keyword in cucumber

example keyword is basically we use like when we have to specify like value for each parameter like for
the username and password when we have to provide a value that time we can use the example
keywords and when we use the example keyword we should always follow like we we have a scenario
right but instead of scenario we have to use the scenario outline keyword that needs to be followed with
the along with the example keyword to providing or specifying the value for that parameters so yeah
that is the can you tell me what is the starting point of execution for feature file like from where the
feature file starts so when we are working with our like when we are working with the selenium and and
working with BDD So what happened is like we we have a test runner classes there so in that we have to
specify like we have to use a certain annotations like number option clues are there so that can be you
know with the help of those thing we mentioned in the test runner class and from there it is the starting
point point we can say that of the feature file should we get exit so yeah OK so can you tell me the one
query like I have to find out this second maximum salary from the employee table so how do I do
OK so there are multiple ways we can do like finding out the second maximum salary so first one is like
we we have a column name like employee name and then we have another column as salad So what the
command is like select name, Max we have to use the aggregate Commission and doesn't salary inside
that aggregate function as salary from employee table where salary and we have to use the operator
which is less than and again we have to use the nested query in that we have to write the command
select Max salary from the employee ohh and then we we can say that like we will get that being a
second maximum salary from the so suppose you have to find out the third maximum salary of a tape
from the table so the syntax or the query will be the same or only once again you have to add like from
employee where salary and again we have to use a less than operator and again we have to write the
same query like select Max salary from the employee so I know we we are nesting a the three times the
same queries but in this way we can get the second maximum salary and there is one another way
where we have to also take care of the employee their salary should not be will not be the same like a it
should be a distinct value unique value so for that we can we can write the same query like select star
from employee where salary we need all the employees whose salary equals and then again we have to
use in this step where we have like select distinct distinct keyword will use for the uniqueness from the
employee and we will use the order by and the salary we have one function limit function that that we
have to use here like limit and -1, one so we need one record for like in -1 will give you give us the
second maximum salary of of from the table so in this ways like there's another way also like but I know
this thing so and this way we can have a second maximum salary of one

OK my last question is can you tell me what is velocity in agile and how do we calculate

velocity OK so velocity something like it is the we are measuring like the how much amount of work as
in team we we did like the in the particular one single Sprint so this is something like the metrics we can
say that where we want to you know you can't get the data like how the entire team is performing how
many number of user story points user are going to take in one Sprint and how much they are able to
achieve it so we we can we can just calculate the velocity like suppose we have a 10 string done already
OK and we want to improve on our velocity thing in the upcoming sprint so what we have to do we have
to calculate the number of users

You might also like