Coded UI Test and Firefox 35.0.1 Issue - unit-testing

I'm trying to use microsoft coded ui tests with firefox. This was NOT an issue until Firefox 35.0.1 came out.
Skip to the bottom if you want to know the issue more than the why am I doing it this way:
Why I'm not using Selenium:
With Selenium, when Firefox launches a web driver, it loses it's previous states/cookie settings. I could of course import a cookie. The problem is that if I have multiple users running the test, they'd either have to set up individual lines of code to import their own specific cookie from their own path. This could become a dangerous game if a user decides to use someone elses cookie.
Why I'm using Coded UI Tests:
Certain applications I am running work exclusively with IE and others work exclusively with Firefox. Since I can't record the instances in IE with selenium, I have to should utilize a coded ui test anyway. I could of course also use watin. But at some point, why run Selenium, and watin when I can instead JUST use a coded ui test. Additionally, when going to the url for login with a coded ui test, FF is setup to save my password and cookie. therefore, the user can save their own password/cookie on each machine and just change the input for username which comes via excel spreadsheet. Everyone gets their own test, and no security issues.
The issue:
Since Coded UI tests don't recognize Firefox as a browser, it recognizes Firefox as a windows application. Therefore, edits and buttons in firefox are considered WinEdit and WinButton for firefox while internet explorer uses HtmlEdit and HtmlButton.
When Firefox put out an update, the coded ui test stopped recognizing certain objects in the firefox window. When trying to manually highlight objects/words with the test builder, it puts the blue box at the head of the web page instead of over what I'm clicking selecting. When hardcoding things to select, it doesn't recognize them. Is anyone aware of a workaround for this issue?

Recording on Firefox/Chrome is not supported by Coded UI. You can record your test in IE and Play it across Firefox/Chrome using Selenium components for Coded UI Cross Browser Testing which can be found here https://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d

Related

Selenium - show notes about what is going on in browser

I'm working on Selenium test which simulates every User action on my website. From registration to modifying forms etc.
There are hundreds of actions so I would like to see what is currently going on. Is there a way to add some notes to Selenium so I can see them in the browser real time? For example some transparent overlay with text?
I think it is possible to create a workaround using AJAX but maybe there is something built in.

Sitecore menu items not working - javascript errors

So I'm just starting to work in sitecore and for some reason none of menu options are working in Page Editor mode for the site that I'm working on. We pretty much have the sitecore website and add some extra page content (MVC app files) to it. I'm getting a variety of javascript errors.
In content Editor, if I click the Sitecore logo and click on Properties I get
TypeError: contentIframe.dialog is not a function
In page editor if I click on the blue components button I get:
TypeError: i.widget is not a function
I'm guessing maybe it's a conflict between jquery that we're using for this website and whatever Sitecore is using. I think it's 7 - but I can't see it via the menu option :)
That guess could be wrong - it could in fact be a browser issue, but I've ensured Firefox is not blocking popups. It doesn't work in Firefox, IE or Chrome though.
The weird thing is that no one else on the project is having this issue it's only on my computer.
Edit - I've also just tried re-installing (7.2) without any local code changes I still can't click on a page and go to Presentation, Details (Layout) - I get a TypeError: contentIframe.dialog is not a function
Edit 2 - I've noticed that I can use sitecore in the QA environment and the dialogs work fine there. So it's something specific to my local build of the site we have (sitting on top of sitecore). But the dialogs just throw jquery errors when I do stuff locally. I was hoping it would be a browser setting but doesn't look like it.
Edit 3 - What I've tried this morning.
Same thing happens in all browsers (FF, IE, Chrome) and I’ve cleared
my browser cache I can access the QA site and the dialog appears as
expected
Copied across the QA site files, pointed my local Digital
site in IIS to the new folder – dialogs don’t work
Team member tried accessing the site from his machine (pointing to my IP address) and
dialogs work for him
I tried seeing if another local sitecore site dialogs were working – but the menu items for that are opening as new windows (so I’m guessing it’s a sitecore 7.2 feature that they appear as jquery dialogs??)
So after googling for rejected-by-urlscan it turns out there's a program called UrlScan from microsoft that was blocking my dialogs. Uninstalled that and I now have dialogs appearing for sitecore. Very exciting :)
I guess it is a problem with some browsers plugin. Sitecore is sensitive to scripts that are used(different versions of jquery or prototype.js). Plugins can inject scripts to HTML source of pages and it can cause errors.
Try to switch off all plugins at least at one browser and check the results.

Qooxdoo reuse cookies between sessions?

Recently I have create some UI tests for a qooxdoo application with the built-in simulator ( I am using qooxdoo 3.0.1, selenium-server-standalone-2.35.0 and firefox23)
and I need to store a cookie in the browser and save that for the next time that it open.
code that stores the cookie:
if(!this.getQxSelenium().isCookiePresent(debugVariable))
this.getQxSelenium().createCookie("debugVariable=0","path=/, max_age=350000, domain=subdomain.foo.com");
console.log(this.getQxSelenium().getCookieByName("debugVariable"));
I have find that there is an argument in the server the -profilesLocation that specifies the directory that holds the Firefox profiles that java clients can use to start up the Firefox
I even try to use -browserSessionReuse but it does not working either for me.
I see this is not enough what other solution I could try to make the Firefox to remember the cookies?
This is not a qooxdoo-specific issue. I tried it with a plain HTML+JS page and Selenium's -firefoxProfileTemplate option and it didn't keep the cookie either.
You could try using an older version of Selenium (and perhaps also Firefox). -firefoxProfileTemplate is specific to Selenium RC, which is deprecated and gets more broken with every new release.

howto hide firefox add-on popup initiate by selenium rc?

everytime i test my selenium test, the instant of firefox will popup and show page of selenium rc. It's ok and cool. But i have problem. For every test i also have to see a firefox's page pop up and shown selenium plugin have been add to firefox.
is there any way to configure selenium so it initiate firefox without a popup page cause after a hundred test, it start to irritate me ;D
I'm sure this is a duplicate of another SO question, as I feel like I've answered it before, but I can't find it. If I do subsequently find it then I will update my answer.
You need to set the extensions.lastAppVersion preference to match the version of Firefox that you're launching. Otherwise you will generally have an additional tab in Firefox and the Addons manager popup.
You may need to configure Selenium to use a custom Firefox profile in order to make this change.
Removing the extensions.rdf file from profile directory will fix this issue . I have created a separate profile for Selenium tests, which is only used for Selenium Tests. I would love to hear if there is other way around . My "extensions.lastAppVersion" is updated and reflects the current browser version therefore the above trick does not work for me .
Remember, invoking selenium by user will re-create extensions.rdf file, therefore I prefer to keep separate profile for Selenium
Having found this answer and had a go, I found that merging the Extensions.rdf and extensions.ini file from the temporary profile created in a Selenium session and putting that into your Custom Profile directory solves this problem.
When merging extensions.ini, be careful to avoid getting the pathnames wrong.
Use this -
From the address bar type “about:config” and add/update the following:
- extensions.update.notifyUser (type=boolean; value=false)
- extensions.newAddons (type=boolean; value=false)
It worked for me.

Iphone and php application

I created php pages.. those php pages are registration form.with the fields.FirstName,LastName and CompanyName...If I fill the information in that form and hit submit the data will store it on the mysql database.And I created one page...that displays the data which I have added through register form...I have a button on this page which displays the data...my question is when I click that button...my display data must store on the Iphone ...is that possible to do.....or any other solution.....and how to use php on Xcode....?
You appear to be confusing server and client-side programming.
If you want to run stuff on a website on the iPhone to save locally, you will have to use HTML5 and Javascript, and HTML5's feature for local databases (if the iPhone doesn't support this currently, it certainly will soon).
PHP will run on the server, if you want to save the data on the server-side.
If you want to run stuff only locally on the iPhone, then you'll want to look into XCode and Objective-C. The iPhone uses SQLite as a local database for applications to use.
Are you opening your webpage in Safari on the iPhone, or are you planning on having an application running?
If you have a server with a PHP application, why would you want to store the "display data" on the iPhone? Is this for offline use?
Users can copy/paste info to notes on their iPhone, though this is not a very handy solution.
If you want the phone to remember the data locally, you can set the expire header of your application to a date in the far future, but be careful as this has risks if you change data and the client doesn't learn about it because it thinks it has a valid local copy.
Also, read this (short) article about caching data with HTML on the iPhone: http://ajaxian.com/archives/html5-features-in-latest-iphone-application-cache-and-database
That suggests it is supported. But, I wouldn't know how. I'm sure google can help you there.
You could just capture the user's information in standard UITextField's and then submit the form programmatically using ASIFormDataRequest from the ASIHTTPRequest library. It's made specifically for posting data to a form.