This is a migrated thread and some comments may be shown as answers.

Accessing alias instead of webelement directly

1 Answer 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
VVP
Top achievements
Rank 2
VVP asked on 01 Jul 2015, 09:38 AM

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 ?

 

1 Answer, 1 is accepted

Sort by
0
VVP
Top achievements
Rank 2
answered on 03 Jul 2015, 05:32 AM

Sorry such a simple thing. i figured it out.

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

Tags
General Discussions
Asked by
VVP
Top achievements
Rank 2
Answers by
VVP
Top achievements
Rank 2
Share this question
or