Q1
How do I copy a content from webpage and paste it in notepad in selenium and validate
Verified Answer
using "driver.getAttribute("text");" to read text or label.
Using "driver.getAttribute("valeu");" to read text box values.
Q2
Why do some projects use selenium with Java and some with c#? Are there any dvantages/disadvantages
Verified Answer
Yes, You can do some project use selenium with java and C#.
Many people prefer java these days in Market.
Because We have very good support for Java with Selenium. Java is a platform independent.
Java is taught in most of the colleges and schools since it’s free.
Q3
Can someone help me with one scenario to Automate:
It's like, I am clicking on next button it is redirecting to next page but on next page some button is visible but loader on page is still loading I want to wait until that loader stop. How to wait until the loader stop?
Verified Answer
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(
ExpectedConditions.visibilityOfElementLocated(By.xpath("someButton")));
Q4
Which is better way of creating object repository in POM?
1. Page wise
2. In .properties file
Verified Answer
Defining WebElements in Page Wise will be the Best.
Q5
how to get the value against supplier dropdown
Verified Answer
u can try this
WebElement ele=driver.findElement(By.xpath("//select[@id='editQuoteItemSupplierId']/option");
String value=ele.getAttribute("value");
Q6
What is best possible way to access a web element whose name Or case selector is keeps on changing. What should be xpath?
Verified Answer
In such cases, you can use xpath using contains().
Might be some part of property of webelements remains same. You can even try with xpath using starts-with
Q7
I can go with customized xpath with the help of sibling or parent relationships
Verified Answer
If u have some static element to decide xpath relative to it ...
Then yes , go with that.
Provided ur xpath doesnt ends up being too complex
Q8
What are the threads in testng? What is use of it?
Verified Answer
TestNG provides multiple ways to execute tests in separate threads. In testng.xml, if we set 'parallel' attribute on the tag to 'tests', testNG will run all the '@Test' methods in tag in the same thread, but each tag will be in a separate thread. This helps us to run test methods / classes / tests in parallel.
Q9
We have 3 class is class a,class b and class c, how do we use methods present in classes a and b in c without creating an abject of class a and b
Verified Answer
If we declare the method s of class A and B as static then in class c we can call those methods by using class name without creating any object.
Without using class name and create object of a and b is it possible to call those methods into class c
Q10
Can I have two pom file and if yes how to execute two pom file separately from cmd. And How to execute both from cmd
Verified Answer
Yes we can have multiple pom.xml files. And Wats the use of two.POM.xml