XQuery

  Home  Computer Programming  XQuery


“XQuery Interview Questions and Answers will guide us now that XQuery is a query and functional programming language that is designed to query collections of XML data. XQuery 1.0 was developed by the XML Query working group of the W3C. The work was closely coordinated with the development of XSLT 2.0 by the XSL Working Group. So learn XQuery or get preparation for the job of XQuery by the help of this XQuery Interview Questions with Answers guide”



41 XQuery Questions And Answers

21⟩ How can I check if a web page contains specific text?

You can obtain the page’s text using the document.body.innerText property and search for the desired text in it. For more information and code examples, see the “Checking if a Page Contains Specific Text” help topic.

 208 views

22⟩ How can I find a web page element that contains specific text?

estComplete provides you with access to methods and properties of web page elements, so you can search all web page elements and find the desired text in the element properties. To perform the search, you can use the Page object’s Find method. This method uses three parameters: Page.NativeWebObject.Find(PropertyName, KeyValue, TagName)

► PropertyName - Name of the property, whose value is checked by the method. Typically, the element’s text is accessible through the innerHTML or innerText property.

► KeyValue - The sought-for text (you can use the * and ? wildcards to specify the search masks).

► TagName - This parameter is optional. You can use it to specify tag names that you would like to search in. Note that since the name of the Find method coincides with the name of the Find method added to all tested objects by TestComplete, the Page object’s method resides in the NativeWebObject namespace, that is, in your script you should call Page.NativeWebObject.Find rather than Page.Find. For code examples, see the Searching for Web Page Element Containing Specific Text blog on our AQCommunity site or the “Searching for the Element Containing the Desired Text” help topic.

 205 views

23⟩ The web page I am testing displays the Login dialog. How can I access this dialog?

When opening some pages, you may see a Login dialog where you should enter the user name and password in order to access the page or the browser may display the Information bar asking for your permission to perform certain actions requested by the page. If you test these type of pages, you need to write code that will:

► Open the page.

► Close the the Login dialog or the Information bar by simulating user actions over them.

► Wait until the page is loaded. Note that the Page.ToUrl method, which is used to open pages, does not return the execution control to the script until the specified page is loaded. In other words, it does not return the execution control until the Login dialog or Information bar is closed. To close the dialog and informative message you should simulate user actions that will close the dialog and the bar. However, you cannot do this since the ToUrl method does not return the control until the dialog and the bar are closed. To work around the problem, you can use any of the following approaches:

► Enter the page’s URL into the Address bar or into the File | Open dialog of your web browser (for example, using the Keys method).

► Use the Navigate or Navigate2 methods of the page object (this is only valid for pages displayed in Internet Explorer or a WebBrowser control).

► Call the Page.ToUrl method using the Runner.CallObjectMethodAsync method.

 202 views

25⟩ The script recorded over the tested web page is not played back correctly. What is wrong?

Most likely the script addresses web page elements by their index. TestComplete uses indexes if the element does not contain the Id or Name attribute (if any of these attributes are specified, TestComplete uses the attribute value to address the element). Using Id or Name is more reliable than using the indexes since the indexes can change from one test run to another. To work around the problem, use any of the following approaches: • In the source code of the tested web page, specify the Name or Id attribute for all controls that you need to work with from scripts. Upon doing this, you will be able to address the controls using the specified identifiers. • Use the Page(…).NativeWebObject.Find method to search for the desired control by values of its properties and attributes (innerText, innerHTML, href, src and so on).

 238 views

26⟩ Does TestComplete support testing of Flex applications?

With TestComplete you can access internal objects of Flex applications. To do this, you should compile your Flex application with the Generate accessible SWF file option enabled and make TestComplete recognize Flash elements as MSAA objects (see instructions in the previous answer). After you prepared your Flex application and the TestComplete project, switch to the Object Browser panel. The available application objects will be displayed under the '...Window("Internet Explorer_Server").Window("MacromediaFlashPlayerActiveX")' node in the Object Browser. These objects are exposed by TestComplete’s MSAA Open Applications plug-in. Note that TestComplete can only access those controls that implement the IAccessible interface. By default, not all objects in Flex applications implement this interface.

 214 views

27⟩ Explain about the DTD features?

This is the oldest form of format for XML is DTD. The full form for DTD is document type definition and it is inherited from SGML. It can be said that inclusion of DTD has increased the popularity of XML but DTD has its share of limitations.

 229 views

28⟩ Explain about XML Canonicalization?

Often it happens that documents are identical in many different ways either logical of statistical. It becomes a major problem when you try to sign a digital signature on two identical documents, to eliminate this problem you have to use Canonicalization which helps people in identifying two similar documents with similar digital signature. Similar documents use Canonicalization to identify similar patterns and signature.

 205 views

30⟩ Explain about core validation?

During the process of XML validation two processes are followed which are 1) Reference validation and 2) Signature validation Record digest value is used to verify digital signature. In signature validation a process called Canonicalization is used, in this key info is used to verify the signature.

 203 views

31⟩ State some features of XQuery?

Some of the features which are present in XQuery language are as follows: -

1) Logical and physical data independence

2) Declarative

3) High level

4) Side effect free

5) Strongly typed language

 210 views

33⟩ Explain about XQuery?

Xquery is a useful query language which is designed to query XML data and it is very useful in making changes to query. Its subset is Xpath. This XQuery is formed from the experts of w3c. This facilitates extraction of data from many different databases. This can be rightly said that in future it will be used as SQL.

 222 views