Telerik Forums
Testing Framework Forum
1 answer
101 views
We have a textblock in a cell as below:

    <contentpresenter Name="PART_ContentPresenter" Uid="40569470">
      <textblock AutomationId="CellElement_0_0" Uid="29580916">3</textblock>
    </contentpresenter>

I am using TTF in Visual Studio. When we start script to catch this cell/textblock. It gets object successfully but in textblock tag, i don't see the AutomationId element. 

However, after i turn on the Inspect.exe tool to try to verify properties on my product, i re-run my script, i see the AutomationId element appears in textblock tag. 

If I turn off inspect tool, restart my application, re-run my script again, i don't see the AutomationId element in textblock tag.... :(

I really need to get the AutomationId property to use it to get exactly data cell i need to work on.

Maybe the inspect tool performs any action on my application,... i am not sure. Could you please help me on this ? do i need to set any configuration in my script ?

Thanks and Regards,
Hoang.
Boyan Boev
Telerik team
 answered on 04 Aug 2014
17 answers
878 views
Hi,

I'm using webAii for test automation. In the following scenarion:
1. Launch a browser and navigate to page1
2. From page1, click a button which open page2 in a new browser window (not a modal popup or a new tab)
3. With page2 opened, make a click inside page 1, so page1 is the active browser window
4. Execute a javascript method on page1 (which is not available on page2)

The test fails with "ExecuteCommand failed! InError set by the client. Client Error: System.InvalidOperationException: Javascript call 'myFunction' failed" because the active browser is the last opened - page2 (not page1 as it has the actual focus)

If between step 3 and 4 i close the active browser (but this action is against my test case), the ActiveBrowser property points to page1.

How can i set the ActiveBrowser to page1 without closing page2?

Thank you,
Flavia

Boyan Boev
Telerik team
 answered on 01 Aug 2014
2 answers
134 views
Hello,

I want to test the following situation, we have 2 type of Silverlight application (lets say admin and client UI) which communicates with eachother using SignalR. If the user clicks on something on the admin UI it does something on the client UI without refreshing the browser. Now I want to test this schenario with the following steps in order: open client UI, check a UI element property, open admin UI, do some action on admin ui, go back to client UI (doesn't matter if admin ui closes or not), do multiple interactions and verification on client UI. The key here is that I have to see if the communication between the components are working and the client refreshes the connecting ui elements without refreshing the whole window. I cannot do this in 1 browser istance.

I read the following on another thread:
"Test Studio is designed around the concept of the "Active Browser". All test steps are automatically directed at the Active Browser. Test Studio does not have the concept of "run this step in window A" and "run this step in window B". It will only use the Active Browser.
"Active Browser" is defined as the last window that was opened. When the test starts a browser window is opened and Active Browser points to this window. If a popup opens as the result of some UI action (e.g. clicking a button) Test Studio will automatically connect to it and consider that browser to now be the Active Browser from that point forward. When the popup window closes Active Browser reverts back to the parent window. Thus if you have Parent -> Popup A -> Popup B, as the windows close Active Browser will revert back to Popup A first then Parent when Popup B closes followed by Popup A closing."

I tried this approach without any good success. Here is what I do:
1. step: coded: 
client = Manager.Browsers[0];
client .NavigateTo("client UI url", true);
popupButton = Find.ById<HtmlButton>("popup");
Manager.SetNewBrowserTracking(true);
popupButton.InvokeEvent(ScriptEventType.OnClick);
Manager.WaitForNewBrowserConnect("admin UI url", true, 50000);
Manager.SetNewBrowserTracking(false);

So I navigate to the client UI, open up a popup window by calling InvokeEvent(ScriptEventType.OnClick) and then navigate to the admin UI on the popup window. The javasript what opens the popup window is a simple window.open('admin ui url')
2. step: doing some recorded action on ActiveBrowser, which is admin UI at this point.
3. step: coded:
ActiveBrowser.Window.Close();

At this point, if I try to do some recorded steps on the client UI I get the following exception, or the Test Studio Test Runner just freeze and stops working.
ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'DocumentMarkup',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_8d7f954c-bfe5-4774-9078-3bf30db32e8f',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.InvalidOperationException: This client 'Client_8d7f954c-bfe5-4774-9078-3bf30db32e8f' is not connected to remote to be able to process command.
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)

So my question is the following, can I do what I want wit the Test Studio, and if i can how? Also it is not clear for me that the Active Browser revert back if I use Manager.LaunchNewBrowser to open the second Browser instance too, or only if it is opened by UI action from the Parent window.

Thank you,
Balazs


















Boyan Boev
Telerik team
 answered on 30 Jul 2014
1 answer
131 views
Hi,

I have a web site that user AngularJS but having a problem getting a button clicked;

The problem here is that I can find the element with id X and does not through any errors clicking on the elment.

My Code:


Console.WriteLine(name + ":Finding Button: " + id);
                var element = myManager.ActiveBrowser.Find.ById(id);
                if (element == null)
                {
                    Console.WriteLine(name + ":Input not found");
                    return false;
                }

                myManager.ActiveBrowser.WaitUntilReady();
                Console.WriteLine(name +":Button Found, clicking on it!");
                myManager.ActiveBrowser.Actions.Click(element);





Nothing happens, no errors etc, below is the html:
  <form role="form"  id="LoginForm" name="LoginForm">
                <input type="text" class="col-xs-6 form-control" id="userName" placeholder="Username" title="Username" ng-model="Login.Model.Username" required local="Username"/>
                <input type="password" class="  col-xs-6 form-control" id="Password" placeholder="Password" title="Password" ng-model="Login.Model.Password" required local="Password">
                <button type="submit" id="Submit" class="btn btn-red col-md-12" ng-click="Login.Login(LoginForm.$invalid)" local="Login">Login</button>
                <p class="text-center"><a href="#NewApplication" class="register-link" local="Register">Register</a></p>
                
                    <select langbar></select>
                
            </form>




Any help would be great.

Thanks
Paul.
Boyan Boev
Telerik team
 answered on 28 Jul 2014
17 answers
411 views
Hi,

I can´t manage to access an iFrame within an other iFrame. I can find it with
browser.Find.ByExpression("tagname=iframe")

but can´t access it with
browser.Frames[0]

This causes an IndexOutOfRangeException. I tried to refresh the DomTree and also tried to reload the frame, but without success.

Do you have any idea how to solve this?

Kind regards
Silvio
ruthjchav
Top achievements
Rank 1
 answered on 26 Jul 2014
19 answers
218 views
The following code works great on IE and FF:
AlertDialog SearchResults200Dialog = new AlertDialog(AiiBrowser, DialogButton.OK);
 
Manager.Current.DialogMonitor.AddDialog(SearchResults200Dialog);
 
Manager.Current.DialogMonitor.Start();
 
consentSearch.SearchClick();

SearchClick() causes the web page to invoke a Window.Alert().

The DialogMonitor never 'sees' the alert dialog if the browser is Chrome.  Is this thanks to our new best friend Chrome v32?
Ivaylo
Telerik team
 answered on 24 Jul 2014
36 answers
533 views
Hi,

I am using the below code to save a file download dialog to a particular path.
Below is my code.

 

Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle; 
DownloadDialogsHandler handler = new DownloadDialogsHandler(ActiveBrowser, DialogButton.SAVE, @"D:\address.xls", Manager.Desktop); 
Manager.ActiveBrowser.WaitUntilReady(); 
Pages.abcd.FrameFrame1.DownloadlinkLink.Click(false);
handler.WaitUntilHandled(9000);

I am getting the attached exception and the file doesnot save.
It opens the SaveAs dialog and doesnot pick the given path and freezes.
Attached is the screenshot of steps performed to save.

Could you please help.

Thanks,
Satya

Cody
Telerik team
 answered on 22 Jul 2014
1 answer
171 views
I'm using the wizard to build a 'WCF Data Service - OData v3' data access service. (I also created the Domain Model using the wizard and populated it from the database.)

My users need to consume the data in the same order as it's defined in the database.  However the columns are being reorganized and delivered alphabetically in ascending order.

How can I get the data to be delivered via OData/JSON in the exact same column order as defined within the database?


Cody
Telerik team
 answered on 21 Jul 2014
7 answers
123 views
Hi there,

I am trying to use Telerik Test Framework to do some UI testing for my web application.  The application uses Knockout framework.  It looks like Telerik testing framework doesn't work very well with Knockout.  One of the issues I encountered is that when I set the text property of a textbox, Knockout binding does not pick up the text.  Here is a sample code snippet.

var aliasInput = Driver.Instance.ActiveBrowser.Find.ById<HtmlInputText>("Alias");
aliasInput.Text = "textToSearch";
var searchBtn = Driver.Instance.ActiveBrowser.Find.ByContent<HtmlButton>("l:Search");
searchBtn.Click();

When searchBtn.Click() was executed, it did not pick up the textToSearch and claims there is nothing to search for.

Here is the how he Alias textbox is implemented:

<input type="text" data-bind="value: Alias" class="form-control" id="alias">

Another issue I encountered is WaitForElement does not work.  Here is my code snippet:

Driver.Instance.ActiveBrowser.WaitForElement(new HtmlFindExpression("tagname=table"), pageTimeout, true);

The WaitForElement method always times out and never finds the tagname=table element.

Can someone shed some light on these issues?

Thanks.




Boyan Boev
Telerik team
 answered on 21 Jul 2014
2 answers
169 views
Hi, I am trying to fire NUnit tests under TeamCity and my tests falls a the first hurdle.

When I execute the following:

_manager.LaunchNewBrowser(BrowserType.Chrome, true);

I get:

SportsArb.Test.dll] 853 ERROR SportsArb.Execution.Agents.UICommon.WebManager - Error setting up browser: System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at ArtOfTest.WebAii.Messaging.Process.HostsProxy.Start()
at ArtOfTest.WebAii.Messaging.Process.HostsProxy.RegisterListener(MessageListener listener)
at ArtOfTest.WebAii.Messaging.Process.ExecutionMediator.RegisterManager(Manager manager)
at ArtOfTest.WebAii.BrowserSpecialized.Chrome.ChromeActions.LaunchNewBrowserInstance(Manager manager)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)


Chrome is installed and extensions are in place and enabled.

I have tried restarting TeamCity with my credentials (has admin) and local service.  I have tried adding a console initiated TC agent, same fault.

I tried adding the exploratory testing extension to chrome and it installs but it fails to launch with "Cannot launch Telerik Exploratory Tool"

Any clues what I am doing wrong?

My test file is C# created using VisualStudio 2010, TeamCity instance is 8.1.3 (build 30101), running on 32 bit Win2008 SP2




Cody
Telerik team
 answered on 16 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?