Wednesday, November 19, 2014
On 1:01 AM by Unknown No comments
Answer 72: Power of recovery scenarios lies with the programming language you
use. If you are using java then you can use Exception handling to overcome
same.
For example if you are
reading data from a file and file is not available then you should keep you
code statements in “try catch” block so that test execution could continue even
in the wake of errors. Such mechanism entirely boils down the errors you want
to recover from, while being able to continue with test execution.
Answer 73: You can use loop features of the programming language, for example
you can use “for” loop in java as following to type different test data in a
text box –
// test data collection
in an array
String[] testData =
{"test1", "test2", "test3"};
// iterate through each
test data
for (String s : testData) {
selenium.type(“elementLocator”,
testData);
}
Answer 74: You can use method getEval() to evaluate java
script.
For example if you want
to count number of images then you can pass following DOM statement to getEval() as
following –
selenium.getEval("window.document.images.length;");
Or to get all anchor objects
from a page
selenium.getEval("window.document.getElementsByTagName(‘a’);");
Subscribe to:
Post Comments (Atom)
Search
Popular Posts
-
Sample Selenium IDE Test Script by Recording: We will use the Mercury Tours website as our web application under test. It is an online flig...
-
Locating GUI Elements Locating elements in WebDriver is done by using the “findElement(By. locator ())” method. The “locator” part of the co...
-
Answer 75 : If you want to see all options available while starting Selenium server then you should use option “-h” while starting Seleni...
-
Answer 60 : While using java you need to create instance of DefaultSelenium class and pass it four parameters – selenium = ne...
-
Answer 51 : Selenium RC is an offering from SeleniumHQ which tries to overcome following draw backs of Selenium IDE – Able to execute...
-
Answer 54 : Selenium core is the core JS engine of Selenium which executes tests on browser, but because of same origin policy it needs t...
-
Answer 18 : You need to use context menu to add check points to your Selenium IDE tests Answer 19 : There are two ways to edit tests...
-
Answer 15 : Yes, you can first record individual test cases and then group all of them in a test suite. Following this entire test suite ...
-
Answer 38 : You could XPath checker - https://addons.mozilla.org/en-US/firefox/addon/xpath-checker/ to test you XPath locators and Fi...
-
Answer 44 : You can change default behavior of Selenium IDE > element locator preference by crating JS file with following– Locato...
Shaik. Powered by Blogger.
0 comments:
Post a Comment