Interview Questions
Interview Questions
Str = ""testing""
Output = e"
ANS=
str='yyogeshhh'
for i in str:
if str.count(i)==1:
print(i)
------------------------------------------------------------
"Write a program to check if given string is palindrome or not. Return true if its palindrome,
return false otherwise
Yogesh Warghade
21m ago
str = "nitin"
str1 =str[::-1]
if str == str:
return True
else:
return False
Interviewer
14m ago
---------------------------------------
Yogesh Warghade
str = input("enter string")
reverse_str = str[::-1]
print("reverse string is :",reverse_str)
Interviewer
What are Dict and List comprehensions?
-----------------------------------------------------------------------------------------------------------------------
. pyc files are bytecode files automatically generated by the Python interpreter during the execution
of . py files. They play a crucial role in improving program execution speed and protecting the security
of the source code.
-----------------------------------------------------------------------------------------------------------------------------
What is swapcase() function in the Python?
Python String swapcase() method converts all uppercase characters to lowercase and vice versa of the
given string and returns it.
---------------------------------------------------------------------------------------------------------------------------
Remote webdriver=Selenium lets you automate browsers on remote computers if there is a Selenium
Grid running on them.
Webdriver=A WebDriver is a browser automation framework. It accepts commands and sends them
to a browser on local computer
-------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------
What are the differences between hard and soft assertions? When do we use which
assertions?
In short, if you need your @Test Method to fail straight away after one of its Asserts fails, use Hard
Asserts. If you want the execution to proceed even if an assert fails, if you want to see how the
following asserts behave, and if you want to see the full result at the end of the test, you need to use
Soft Asserts.
Hard Assert is a technique used in software testing to check whether a certain condition is true or
not. In other words, it is a way of verifying that a certain piece of code is working as expected.
If the two outcomes match, the assert statement passes and the test continues. If the actual outcome
does not match the expected outcome, the assert statement fails and the test is halted. The
remaining tests are skipped and the test is marked as failed.
Soft assertions are the ones in which the test execution does not stop if the test does not meet the
assertion condition. The remaining tests are executed. All the above methods also work with soft
assertions.
Hard Assertions
A hard assertion will halt the test execution as soon as the assertion fails.
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get('https://example.com')
def test_example(self):
driver = self.driver
element = driver.find_element_by_tag_name('h1')
# Hard assert: this will stop execution if the condition is False
self.assertEqual(element.text, 'Example Domain', "Title does not match")
Soft Assertions
Soft assertions allow the test to continue even if one or more assertions fail. This can be useful
when you want to check multiple conditions and gather all failures instead of stopping at the first
one.
import softest
class TestSoftAssert(softest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get('https://example.com')
def test_example(self):
driver = self.driver
element = driver.find_element_by_tag_name('h1')
self.assert_all()
----------------------------------------------------------
What would be approach of adapting the framework when its a complex application
--------------------------------------------------
-----------------------------
----------------
1.diff between white box testing,grey box and black box testing
2.program
input l=[2,4,5,5,7]
output=[5,5,7,(2+4)]
def mod(l,i,j):
print(l)
sum=l[i]+l[j]
l.pop(i)
l.pop(j)
l.append(sum)
l=[2,4,5,5,7]
mod(l,0,1)
print(l)
3.program create list and whichever number occurce twice put in differnt list
l=[5,4,5,7,8,4,9,7,8,4,5,]
l1=[]
for i in l:
if i not in l1:
if l.count(i)>1:
l1.append(i)
print(l1)
or
l=[5,4,5,7,8,4,9,7,8,4,5,10]
print(l)
l1=[]
d={}
for i in l:
if i not in d:
d[i]=1
else:
d[i]+=1
for i in d:
if d[i]>1:
if i not in l1:
l1.append(i)
print(l1)
4.suppose you got build from dev in which features are not developed what will you do
First discuss with developer and team about the build
If there is no module depedacy or any dependency in feature if possible I will test the build else I will
report the build in jeera tool as features measing from the build and testing canot be proceded
7.list/tupple/set
12.
std sub mark
1 en 80
2 en 90
1 sc 80
2 sc 90
output should be
std en sc
1 80 80
2 90 90
13.program
l1=[2,3,4,5]
l2=[4,5,7,8]
output=[8,5,28,40]
13.what you did in project,what data tested,what transformation you performed,difficult data
transformation
14. github actions
15.pull & fetch
16.fixture drawbacks,conftest
17.parametrization
18.if wrong code push to github what will youy do
19.markers
20.you have drop down if value repeates you need to skip it how will you do
21.priority/severity
22.stlc-at which phace testing take place
23.jira-status
24.sql-inner/left join/4th max salary with and without subquery
25.comments to review
26.how to raise defetc in jira/filds
27.str reverse using loop and slicing
28.smoke vs sanity
29.process to get content from github make changes and push again
30.create branch
31.choose branch
32.dev does not accept
33.ATM test cases
34.what immutable in list
35.list/dict comprehencension
36.list compre... l=[yogesh,rajesh,vishal] print only those which has y in it
37.reverse list
38.what is pass used for
39.exceptioins and when that occurs
40.stale elemet
41.how to skip test case
42.diff selenium IDE
43.uses of selenium
44.python over other language
45.unique items in list
46.numpy array
47.math library
48.what is lambda
49.diff automation tools
50.how to install pachage
51.array vs matrix
52.iterator
53.numpy library
54.webdriver
55.data models in python
56.xpath vs css selector
57.diff selenium tool used for automation