Wednesday, November 19, 2014

On 1:03 AM by Unknown   No comments
Answer 21This entirely boils down to operations you are carrying out with Selenium. Though you would definitely be using following Selenium Commands more often –

  • Open: opens a web page.
  • click/clickAndWait: click on an element and waits for a new page to load.
  • Select: Selects a value from a drop down value.
  • verifyTitle/assertTitle: verifies/asserts page title.
  • verify/assert ElementPresent: verifies/asserts presence of element, in the page.
  • verify/assert TextPresent: verifies/asserts  expected text is somewhere on the page.


Answer 22Html id and name can be used as it is in selenium IDE.

For example Google search box has name – “q” and id – “list-b” and they can be used as target in selenium IDE

Answer 23XPath is a way to navigate in xml document and this can be used to identify elements in a web page. You may have to use XPath when there is no name/id associated with element on page or only partial part of name/id is constant.
  • Direct child is denoted with - / 
  • Relative child is denoted with - // 
  • Id, class, names can also be used with XPath –
    •  //input[@name=’q’]
    • //input[@id=’lst-ib’]
    • //input[@class=’ lst’]


If only part of id/name/class is constant than “contains” can be used as –
  • //input[contains(@id,'lst-ib')]

0 comments:

Post a Comment