Beruflich Dokumente
Kultur Dokumente
com
Menu
Skip to content
Home
About us
Manual FAQs
Selenium FAQs
General FAQs
Downloads
Selenium FAQs
Home / Selenium FAQs
Selenium FAQs
1. Q. What is automation and Advantages of automation
A.The process of converting the manual test cases to test scripts by using any
automation tool is known as Automation
Advantages:
1. It saves time by executing the test cases with out manual effort
2. CTC(Cost to the company) can be saved
3. We can maintain Accuracy by repeating the same task in same manner
4. Bugs can be identified
5. We can report the bugs to the developer
6. We can ensure for quality
Classname
TagName
LinkText
Partial Link Text
18. Q. How to create DefaultSelenium object and what parameters needs to be pass
A.DefaultSelenium selenium= new
DefaultSelenium(localhost,4444,*firefox,http://);
localhost It is the machine name and selenium server should be configured in the
specific machine
4444 Its selenium port number.
*firefox Its is the command to launch firefox
http:// Protocol to open URL
19. Q. How many types of Xpaths are available
A.Xpath is two types:
1. Relative XPath
2. Absolute XPath
20. Q. What is the difference between single and double slash in Xpath.
A.// is the starting point of the Xpath.
/ will navigate into the tag
Ex: //html/head/body/div1/div2/
System.setProperty(webdriver.ie.driver, E:\\Library\\IEDriverServer.exe);
driver=new InternetExplorerDriver();
driver.get(http://gmail.com);
bw.close();
fw.close();
35. Q. How to take or print data from XML file
A.File fXmlFile = new File(D://file.xml);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
doc.getDocumentElement().normalize();
System.out.println(Root element : + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName(staff);
System.out.println(-);
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
System.out.println(\nCurrent Element : + nNode.getNodeName());
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
System.out.println(Staff id : + eElement.getAttribute(id));
System.out.println(First Name : +
eElement.getElementsByTagName(firstname).item(0).getTextContent());
System.out.println(Last Name : +
eElement.getElementsByTagName(lastname).item(0).getTextContent());
System.out.println(Nick Name : +
eElement.getElementsByTagName(nickname).item(0).getTextContent());
System.out.println(Salary : +
eElement.getElementsByTagName(salary).item(0).getTextContent());
}
}
40. Q. How do you handle Ajax controls using selenium? i. Eg. By typing in search
engine how do you capture the auto suggestion
A.Ajax control means when we enter some text in the google text box, it display the
auto suggested values. That text box is an ajax control.
Type the value in the textbox and capture all the suggested values in a string.
Split the string and take the values
41. Q. How do you select the 2nd item in a List box or drop down.
A.new Select(driver.findElement(By.id(id))).selectByIndex(index);
46. Q. What are all things can not be done through selenium IDE
A.We cant perform below testings
1. Regression testing
2. Retesting
3. Static Testings like GUI and Validations
4. DB Testing
5. It doesnt provide Test Report
52. Q. If the default port of selenium is busy then which port you use?
A.Selenium by default uses 4444 port no. If the port is already used by any other
server then we can change it to any other 4 digit no.
Ex: 5555 or 1234 or 6666
55. Q. Write a program to get all the text boxes in mail.in register page with webdriver
A. List<WebElement> str=driver.findElements(By.tagName(textbox tagname));
System.out.println(str.size());
for (int i = 0; i < str.size(); i++) {
System.out.println(str.get(i).getAttribute(id)); //To prnt ids
}
driver.manage().window().maximize();
driver.get(http://spicejet.com);
Actions a=new Actions(driver);
a.keyDown(Keys.CONTROL).sendKeys(Keys.END).build().perform();
Thread.sleep(1000);
a.keyDown(Keys.CONTROL).sendKeys(Keys.HOME).build().perform();
a.keyDown(Keys.ALT).sendKeys(Keys.F1).build().perform();
Contact Me
Quick Links
About us
Downloads
General FAQs
Home
Manual FAQs
Selenium FAQs
New Batches
Testimonials
Sindhu : I am very happy to choose Nagesh sir's class. The best thing in him is the way of
delivering the concept. Its simply awesome. He will maintain the consistency from the beginning
to the end of all the classes.Thank you very much for giving me such a great start up for our
career. The way you are teaching is awesome.Truly we got addicted to your classes, which is
simple and perfect. Thank you once again for the best training.
Copyrights@2014.All Rights Reserved by Selenium4testing.com Design & Developed by LG
Soft Solutions