Accessing alias instead of webelement directly

2 posts, 0 answers
  1. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 01 Jul 2015 Link to this post

    Hi,

     In our automation testing, we use controls directly in scripts

    ie.Pages.HtmlPage.textdropdown  etc

    But recently there was some changes and we spent lots of time replacing each and every statement with new control

    So i was thinking to move this "Pages.HtmlPage.textdropdown" to a library file with name "DropdownField" and access it in scripts.

    I tried like

     1) HtmlSelect dropdown List= Pages.HtmlPage.textdropdown;

    2) Pages.HtmlPage.textdropdown DropdownField

    But i am getting error like Pages.HtmlPage is a property but used like a type.

    Any method for accessing html element from a library ?

     

  2. VVP
    VVP avatar
    61 posts
    Member since:
    Mar 2015

    Posted 03 Jul 2015 in reply to VVP Link to this post

    Sorry such a simple thing. i figured it out.

       public HtmlSelect DropdownList()
            {
                return Pages.HtmlPage.textdropdown;
            }

Back to Top