Watin support for IE 9 - Part 2 (Specific) - watin

Watin Runtime Version: v2.0.50727
Browser: IE 9
I have found a specific issue:
BaseIEController.IE.Element(fieldname).Exists throws an Exception as under:
"It's not possible to find the element because no element finder is available."
The fieldname here is a Regex for a link, a simple Regex where the Link's Id is passed.
This works with IE 8.
I cannot use the Final Release of Watin 2.0 since the LogonHandler is not complete (not fully functional as mentioned in the Release Document. I have tried testing it as well).
Any idea on how I can get this Element thingy to work??
Thanks,
K

Today I have upgraded to IE9 on my windows 2008 system and run all the 745 WatiN 2.x unittests and found no issues (accept for one dialog handling the javascript::return dialog fired by onbeforeunload event).
Let me know if you have more specific info/ code example will help too to reproduce the issue you reported.
Jeroen
Lead dev WatiN

Thank you for the response. Firstly, Awesome job with Watin :)
I am trying to run the test using VS2008 and IE 9. The goal is to Click a Link but before that I am verifying if the Link is exists.
The Regex I use for this link is LnkSignIn = new Regex(".*linkSignIn$");
I then use BaseIEController.IE.Element(fieldname).Exists where the fieldname is an Attribute Constraint (in this case the Regex). This would return a true or false if the Link is found. If found, I then click the Link. Instead it returns the Error MyTestInitialize threw exception. WatiN.Core.Exceptions.WatiNException: WatiN.Core.Exceptions.WatiNException: It's not possible to find the element because no element finder is available.. at WatiN.Core.Element.WaitUntilExistsOrNot(Int32 timeout, Boolean waitUntilExists)
...
This works just fine with IE 8. Further, I noticed that if I change Element to Link, it returns true. But since this is a generic method, I want to keep it as element. Hope this helps. Please let me know if you need more information. Thanks.

Related

How to get iOS alert text in appium 1.6

Before upgrading to XCode 8 and subsequently Appium 1.6 and IOS 10 for some appium tests, I used to be able to use the below XPath to capture the main text in an alert.
#iOSFindBy(xpath = "//UIAAlert/UIAScrollView/UIAStaticText[2]")
private MobileElement alertText;
However something has changed and this no longer works. I would still like to be able to assert on the alert text and don't want to use the IOSMobileCapabilityType.AUTO_DISMISS_ALERTS capability.
Has anyone found a way to get at the alert text?
Bonus question: Where is all this XPath documented? I found it on some random forum, but I can't find any official documentation or figure out how it relates to a captured View Hierarchy in XCode.
Answering my own question in case it helps anyone else.
Due to the appium inspector not working with XCode8, the best way to print the screen layout XML is just to do a System.out.println(driver.getPageSource());
Then you can follow the structure and do something like
#iOSFindBy(xpath = "//XCUIElementTypeAlert//XCUIElementTypeStaticText[2]")
private MobileElement alertText;
I got that from this question: Finding elements by xpath in Appium using XCUITEST driver

API KIT Console in Mule not showing any Output

I tried to look through all the tutorials for RAML and I was pretty excited.
I found most of the online resources available but I could not understand why, when i set up everything and the flows are generated, then i run it locally as a mule application, when i point to localhost:8081/api/console/ i get a huuuuuuuge json response, but not the UI described for example here.
Yes i also faced the same issue with Any Point Studio. It is not at all displaying in the API KIT Console present in Any Point Studio. But to feel good and to see the output i have just tried it with Google Chrome Browser and i got the expected User Interface as i was expecting from API KIT Console. Hope this issue will be fixed from next release onwards.
Here is the URL i used to see it on Browser : http://localhost:8081/remote-vending/api/console/
Here is my output from Google Chrome browser for the API KIT Tutorial
My GUI didn't show in the Anytime studio tab: APIkit Consoles, one way to fix this:
make sure you have started your application
right click for the context menu
select encoding
click auto-select
I have had the same problem and resolved it by removing invalid whitespace. One of the example files I was including had an invalid trailing space.
The way I found out;
Open the Network panel in the Developer Toolbar in your browser
Go to http://localhost:8081/api/console/
Find the response for a request to '/api' with the request header 'Accept:application/raml+yaml'.
This response should contain the fully compiled RAML, where all include files have been included.
Copy this entire content into a new RAML-file in Anypoint Platform API Designer or some other YAML editor with error reporting.
It highlighted the invalid whitespace immediately for me.
It should work Out of the box.
It could be a bug of an earlier version.
Could you check the behaviour in more recent releases?
Changing my default browser from Firefox to Chrome resolved the issue for me.

ASP.NET MVC 3: Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'

Error context:
Visual Studio 2010 Service Pack 1
ASP.NET MVC 3 Application
IE9 with Script Debugging enabled for Internet Explorer
Error conditions:
Execution stops int a JavaScript file called "script block [dynamic]" at the following line
doc.addEventListener("DOMNodeInserted", onDOMNodeInserted, false);
that line of code is nested inside the following if block
if (ver >= 9.0)
{
doc.addEventListener("DOMNodeInserted", onDOMNodeInserted, false);
doc.addEventListener("DOMNodeInsertedIntoDocument", onDOMNodeInsertedIntoDocument, false);
}
This is a very persistent error that started happening after I re-imaged my hard drive and reinstalled VS 2010 SP1 and ASP.NET MVC 3. I did it twice to make sure I did it right.
I am going to take a guess and suggest that this bug is the side affect of an un-handled exception in ASP.NET MVC 3 or a bug in IE9. The error seems to ocurr when a (GET?) action method cannot be found that is specified in the ActionLink HTML helper method such as
#Html.ActionLink("Link Text", "Action")
I believe that IE9 does support addEventListener so the error itself is incorrect. Unless I can get more info this error is beyond my ability to fix its cause. I can prevent it by making sure that my action method is there and that it works. That is a workaround not a fix. Fixing the error would prevent it from being erroneously reported because IE9 does in fact support addEventListener.
An answer has been found to this question. The problem was caused by the Divix browser plugin
Solution: Object doesn't support property or method 'addEventListener'
Thank you to a poster on the asp.net forums for helping to solve this problem. The Divix browser plugin has recently been updated. The update may have fixed this issue. However, it remains disabled on my system. Disabling the Divx plug-in definitely fixed this issue for myself and others. I have reported this bug to Divx support.
I've been getting this error today while working on a VS 2010 project, I was using IE9 for my browser. Turns out it's an erroneous message, I should have been getting a page not found error. I tried disabling Divx as mentioned above, but that didn't help. I then tried using Chrome and it reported my error correctly and I was able to solve my problem.
If you get this error, try a different browser which may point you in the right direction.
I turned off Compatibility Mode (was running on local intranet) and the problem went away.

Paypal-Sandbox buying with Selenium RC

I'm trying to buy something at Paypal-Sandbox with Selenium RC (Java), but it doesn't work.
I tried it with Selenium IDE (Firefox AddOn) and it did work. I changed the viewing and copied the JUnit 4 Code and it still doesn't work.
The problem is the part with the radio-button "payment_type_paypal". Somehow it doesnt work in RC (the radio-button is not checked). Do someone have similiar experiences and/or resolved the issue?
After loging in to developer.paypal.com and entering the homepage...
//linking homepage
selenium.click("legalTerms");
selenium.click("pay");
selenium.waitForPageToLoad("30000");
//leaving homepage and switching to paypal
selenium.click("payment_type_paypal"); // <===== point of error
selenium.type("login_email",username);
selenium.type("login_password",pw);
Thx :)
its me againg, Krzys. I know now the Problem. Its an issue with focussing the correct frame. I couldn't get it work with Selenium RC.
You can easily fix the issue in Selenium WebDriver with the command, before my "point of error":
driver.switchTo().defaultContent();
its me again. If you encounter problems with the Sandbox System of Paypal, you can overcome the "submit"-button issues using xpath.
driver.findElement(By.xpath("//div[#id='nav-menu']/form/ul/li/ul/li[6]/input")
Greetz
Krzys

Watin - IE8 hangs on FileUpload.Set

Whenever I call FileUpload.Set, IE8 will open up the file browser window and just sit there without typing any text. This is on Windows XP and it used to work just fine until I upgraded from Ie7 to IE8. Anyone else run into this?
Turns out this line in the WatiN source was the problem:
if (Process.GetProcessById(window.ProcessID).ProcessName != "iexplore") return;
For some reason, the iexplore process on this machine appears as "IEXPLORE", in all caps. Adding a .ToLower() to the process name fixes the problem.
edit: looks like this bug has already been reported.
Because of the way WatiN looks for the dialog box (by style number), it's understandable that IE8 would be broken in versions less than 2.0. You may want to try it with the 2.0 beta.
Alternatively, you can dive the style numbers on the FileUpload DialogHandler and add the style numbers for IE7 and 8 (96CC20C4 and 96CC02C4).
I'd like to post an update for this problem since it came up again in Win7 OS.
If you have the same problem in the latest WatiN release you can override the function CanHandleDialog in the FileUploadDialogHandler class:
public override bool CanHandleDialog(Window window, System.IntPtr mainWindowHwnd)
{
return true;
}
It's not a clean solution but it is the simple and works.

Resources