Question
How do I execute Javascript directly

Answers

We believe that most of the time there is a requirement to execute Javascript there is a failing in the tool being used: it hasn’t emitted the correct events, has not interacted with a page correctly, or has failed to react when an XmlHttpRequest returns. We would rather fix WebDriver to work consistently and correctly than rely on testers working out which Javascript method to call.

We also realise that there will be times when this is a limitation. As a result, for those browsers that support it, you can execute Javascript by casting the WebDriver instance to a JavascriptExecutor. In Java, this looks like:

WebDriver driver; // Assigned elsewhere

JavascriptExecutor js = (JavascriptExecutor) driver;

js.executeScript(“return document.title”);



Other language bindings will follow a similar approach. Take a look at the UsingJavascript page for more information.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Write a program in C to calculate simple interest and compound interest.
  • Q What's the difference between UDP and TCP?
  • Q Transcriptionists do not need to follow standard capitalization rules.
  • Q Explain how you can several classes at once?
  • Q When a person has information about a news story or information worthy of reporting how do they go about it? do they set an appointment with a reporter or does the reporter seek them?
  • Q What tools will help to program with threads?
  • Q The measurement of the combustion quality of diesel fuel during compression ignition is known as?
  • Q What do you know about IRDA and tell some of its functions?
  • Q Does garbage collection guarantee that a program will not run out of memory?
  • Q Any idea about deflation and deflationary spiral?
  • Q Can Rmi registry be written in the code, without having to write it in the command prompt and if yes where?