Completed
Last Updated: 04 Apr 2013 07:37 by ADMIN
ADMIN
Plamen
Created on: 28 Feb 2013 15:32
Type: Feature Request
1
Implement a GetText method in the Actions class
Implementing wrapper functions over built in methods like click, set text etc is difficult as we cannot pass the recorded element as an argument to a method.
 
So the work around I found was to pass find expression to the function and reconstruct the element object in the function.
Now If I am writing a custom click method, I can reconstruct the element to HtmlControl object and perform click on it, like:
 
 HtmlControl element = ActiveBrowser.Find.ByExpression<HtmlControl>(FindExpression); 
 element.Click();

But HtmlControl does not have other methods like SetText. To create custom SetText I did the following:

 Element element = ActiveBrowser.Find.ByExpression(FindExpression); 
 ActiveBrowser.Actions.SetText(element, "Text to set"); 

This is more generic since it would set the text on controls like HtmlInputText and HtmlTextArea. However now I want to get the text content from any component, but the problem is that there is no GetText method in the ActiveBrowser.Actions class.
  
1 comment
ADMIN
Konstantin Petkov
Posted on: 06 Mar 2013 09:34
The purpose of the Actions class is to include the various generic actions like Click, SetText, InvokeEvent, etc. There is no place for retrieving values from the elements there, this is not an action over the DOM and element.

I don't see the problem of finding your HtmlInput, TextArea, etc. and getting it's text accordingly. If there is such a problem please do not hesitate to file a bug. Thanks!