Telerik Forums
Testing Framework Forum
10 answers
207 views
Hi,
I am using MBunit tests for UI automation. My test involves clicking on OK button on a confirm dialog. The test work fine when executed individually. But if i run multiple tests in a class where few other tests are executed before the test involving confirm dialog, the dialog is not handled:

I have tried following option:

1. confirmDialog = new ConfirmDialog(ActiveBrowser, DialogButton.OK);  

      Manager.DialogMonitor.AddDialog(confirmDialog);

2. Manager.DialogMonitor.AddDialog(AlertDialog.CreateAlertDialog(ActiveBrowser, DialogButton.OK));
    Manager.DialogMonitor.Start();

3. Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);


But none is working in batch, however they all are working fine if test is executed alone. Please guide if there is any other was to handle dialogs.

Thanks,
Rohit
dan
Top achievements
Rank 1
 answered on 01 Nov 2016
1 answer
155 views

HI,

I am using just Telerik Test Framework. And trying to click button, but it doesn't responds.

What to do? Please, help.

P.S. 

I use Viisual Studio 2013 Community Edition, NUnit v.2.6.4

P.P.S.

Attaching project for this. Run TestApplication ones.

Nikolay Petrov
Telerik team
 answered on 26 Oct 2016
1 answer
212 views

We are using the Testing Framework (version 2016_3_0928_5) against a site that is forced to use IE 11 in Enterprise Compatibility Mode and we often see the following exception while executing the tests:

System.InvalidOperationException: Javascript call [var eventObjJSON = 'null';var eventObj = JSON.parse(eventObjJSON);var eventType = "HTMLEvents";var eventName = "change";var evt = document.createEvent(eventType);if (!evt) throw "Error creating event";var altKey = false;var ctrlKey = false;var shiftKey = false;var metaKey = false;if (eventType == "HTMLEvents" || !eventObj) {evt.initEvent(eventName, true, true);}else {if (eventObj.modifiers & 0x01)altKey = true;if (eventObj.modifiers & 0x02)ctrlKey = true;if (eventObj.modifiers & 0x04)shiftKey = true;if (eventObj.modifiers & 0x08)metaKey = true;if (eventType == "MouseEvents") {var button = 0;if (eventObj.button & 1)button = 0;else if (eventObj.button & 2)button = 2;else if (eventObj.button & 4)button = 1;var relatedTarget;if (eventObj.relatedTarget)relatedTarget = eval(eventObj.relatedTarget);evt.initMouseEvent(eventName, true, true, window, 0, eventObj.screenX, eventObj.screenY,0, 0, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);}else if (eventType == "KeyboardEvent") {var keyCode;var charCode;keyCode = eventObj.keyCode;if (eventName == "keypress") {charCode = eventObj.keyCode;}else {charCode = 0;}var keyNum = String.fromCharCode(parseInt(keyCode)).toUpperCase().charCodeAt(0);var keyIdentifier = "U+00" + keyNum.toString(16);evt.initKeyboardEvent(true, true, window,keyIdentifier,0, ctrlKey, altKey, shiftKey, metaKey);}}var target = document.getElementsByTagName('select')[1];target.dispatchEvent(evt);] failed! Please make sure the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Object doesn't support property or method 'createEvent' 

Has anybody encountered a similar error and found a resolution?

Any help would be greatly appreciated.

Thank you,

Greg

Elena
Telerik team
 answered on 25 Oct 2016
3 answers
121 views
Query 1:
From the IDE I have set the default browser to be IE for the testlist. Then through a bat file I execute the test list. It opens a blank IE screen and then nothing happens. The same test runs successfully using Chrome. So Wanted to know what is missing in case of IE browser when trying to execute using ArtofTest.Runner. Following is the snapshot of the bat file I use.

 

Query 2:

I have multiple test lists (segregated based on the functionality of the software.) How can I execute all the testlists under the TestList folder using ArtofTestRunner?

IF EXIST "C:\Program Files (x86)\Telerik\Test Studio\Bin" goto :a
echo not found
pause
exit
:a
setlocal
path=C:\Program Files (x86)\Telerik\Test Studio\Bin;%path%
call ArtOfTest.Runner.exe list="C:\TFS\TestWare\Branches\10.1\Automated testing\Level7FO\TestLists\%%I"

 

 

Elena
Telerik team
 answered on 24 Oct 2016
1 answer
232 views

Dear Telerik Support Team,

I´m using the latest version (released on 28th of September) of Telerik Test Framework - I did not isntall Telerik Test Studio, only the Framwork.

My windows has a build number of 14 393, so I downloaded the correct Microsoft WebDriver exe from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ page. The newest WebDriver gives me a single exe file instead of a full installer. Unfortunately I cannot run my tests on Edge browser, because I always get the following exception: "Microsoft WebDriver is not installed!"

How can I make this working? Even if I copy the newest WebDriver.exe file to my C:\Program Files (x86)\Microsoft Web Driver folder - this is the install path of my old webdriver - , Edge tests are not running at all.

Thanks in advance!

Boyan Boev
Telerik team
 answered on 14 Oct 2016
9 answers
612 views
My site has a lot of long-form content, so most pages have a scrollbar. Trying to use the Capture method on the browser to get a screenshot works, but only for the visible frame. Is there a way to capture the entire contents of the page to a screenshot?

I was thinking about doing scrolls, but I can't seem to find a scroll / page height that I can use to calculate how far and how many times I need to scroll so I can stitch together an image. Is it possible to get such information?

Thanks,
Nick
Boyan Boev
Telerik team
 answered on 05 Oct 2016
1 answer
152 views
  1. When I run the recorded telerik test using MSTest, it opens the browser opens webapp and performs the test successfully.
  2. When I automate the test using bamboo, it opens the browser does nothing and gets timed out.
  3. Executing test: 'webtest', path: 'webtest.tstest.'
    - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2016.2.630.0'.
    Starting execution....
     Failure detected during execution. Details:
    ------------------------------------------------------------
     System.TimeoutException: Wait for condition has timed out
       at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
       at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
       at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
       at ArtOfTest.WebAii.Core.Manager.WaitForBrowserToConnect(Int32 browserIndexToWaitFor)
       at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
       at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InitializeWeb(ExecutionEngineCreateParams initParams)
       at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.CreateAndInitializeEngine(Test test, ExecutionEngineCreateParams cp)
       at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand command)
    ------------------------------------------------------------Test completed!
Nikolay Petrov
Telerik team
 answered on 03 Oct 2016
3 answers
109 views

Hi,

I need a While loop that will execute its loop until an element's text content equals 'Active Accounts'. Like so...

 

while(Verify 'TextContext' 'NotEquals' 'Active Accounts' on QuerySelector)

      click selector

 

 

Note, using 'Not Contains' in the condition won't work because a possible text content value is 'My Active Accounts', which I must be able to differentiate from 'Active Accounts'.

 

I tried the Regex negative look ahead expression   /^(?!.*Active Accounts)/g, but that didn't work.

 

So, how can I implement an effective 'NotEquals' in a while loop?

 

Thanks,

dan

 

    
Nikolay Petrov
Telerik team
 answered on 30 Sep 2016
5 answers
115 views

This is the map for the application:screenshot.

 

I tried to locate one of the buttons using "visible" and "exists".

How can I locate this buton, it seems it is hidden too deep.

What should the approach be ? (It seems the developers build a wizard here which consists from four grids).

Elena
Telerik team
 answered on 29 Sep 2016
6 answers
123 views

Hi:

I am doing my first UI testing.  The rendered code can be found in the comments;

public string ValidationError
{
    get
    {
        // <div class="validation-summary-errors" data-valmsg-summary="true">
        //  <ul><li>The user name or password provided is incorrect.</li></ul>
        // </div>
        _browser.Manager.ActiveBrowser.AutoDomRefresh = true;
        _browser.Manager.ActiveBrowser.RefreshDomTree();
        System.Threading.Thread.Sleep(500);
        return _browser.Find.ByAttributes<HtmlDiv>(_validationErrorsSelector).Find.ByTagIndex("li",0).InnerMarkup;
    }
}

I can see the value on the screen, but what is returned is an empty string.  It is finding by attribute OK, but the ActiveBrowser DOM does not seem to be what is rendered.

Phil

 

Boyan Boev
Telerik team
 answered on 28 Sep 2016
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?