0

I'm looking for a test automation framework I can embed in an iFrame, to describe and simulate browsing, which will probably be translate to JQuery-simulate events.

theheadofabroom
  • 15,961
  • 5
  • 29
  • 63
Guy Korland
  • 7,479
  • 12
  • 48
  • 94
  • can I ask if you have tried Selenium2Library, and if so why it's not appropriate? – theheadofabroom Feb 03 '13 at 09:39
  • I'm not sure I follow, can I run it on the client? It seems like it's a backend/server like selenium. – Guy Korland Feb 04 '13 at 08:19
  • selenium's 2 webdriver hooks into the browser itself, and should be able to see anything the browser can see. ([the docs](https://code.google.com/p/selenium/wiki/GettingStarted)) – theheadofabroom Feb 04 '13 at 11:21
  • Yes I understood, but can I embedded it in my website? So I can run a robot script on the website? – Guy Korland Feb 04 '13 at 18:25
  • 1
    You want to embed the the test directly into your website? Can I ask why? for a start this means you will not be using robotframework, so I'm not sure why you tagged it, but beyond this, I do not believe that deploying your tests to every client of your website is standard, or even good, practice... It's certainly not something I've ever seen proposed seriously before now. If this is something you proceed with I'd be interested in seeing the results, but I'd guess you may end up having to write your own framework... – theheadofabroom Feb 05 '13 at 09:59
  • maybe using the tag was wrong, what I want is not for testing but I want to be able to run a user simulation on the client side. – Guy Korland Feb 05 '13 at 14:42
  • ok, can I ask why? your purpose will dictate your approach. It may well turn out that simulating a user is not what you want anyway, and I doubt that an iFrame will be able to interact with another element on a page. – theheadofabroom Feb 05 '13 at 15:26
  • I want to create an iFrame inject a javascript using an extension and walk-through simulate a process on the website and then hand it to the user. This way I can save him a lot of time. – Guy Korland Feb 05 '13 at 21:17
  • But ***why*** do you want to do this? What is your purpose? I can answer for your chosen implementation, but you probably don't really want to do this, but in fact something else... – theheadofabroom Feb 06 '13 at 10:34

1 Answers1

2

What you're trying to do is difficult and uncommon, and for good reason. Firstly let's take the technical aspect.

Dealing with your chosen solution:

I've not managed to come up with any frameworks that will do what you want, but you may want to look at the accepted answer for How to communicate between iframe and the parent site? - what you're trying to do operates in the opposite direction, but the principle is the same. Essentially there is a good chance that you will not be able to achieve what you want to do unless you control both the outer and inner websites, and even then, it won't work in all browsers.

Finding a better way:

So now that the technical side has been tackled, here's the real meat of the matter - are you really sure this is what you want to be doing? A number of scenarios with different solutions:

  1. You're guiding someone through using a service you control:

    Create a guided copy of the page, with the interactions built in - then embed this.

  2. You're guiding someone through using a third party service:

    Record a video, you can even include a voiceover and closed captions to explain why the user must do certain things, and which parts are optional. This would also work well with the above scenario.

  3. You're streamlining an interaction with a service you control:

    This gives you options - you almost certainly don't want to embed the page, but want to work with the backend, either directly or through a RESTful inteface.

  4. You're streamlining an interaction with a third party service:

    The RESTful interface is your friend, if the service has one, if not, see if they have any other sort of API - if they don't contact them and see if you can work something out.

So what is the issue you are actually trying to solve?

Closing comments

When faced with a technical problem it's often tempting to accept the first solution you come up with, but be aware, it's probably not the best. This is not to say that you should spend endless time deliberating over what to do for each and every problem, but you should probably spend at least another couple of minutes considering the problem before choosing what to do, and if you get stuck, try something different.

It may well be that you can't think of any other solution that could possibly solve your problem, and you might be right, but if you can't get it to work, and you come looking for help, please let people know what the problem is that you're trying to solve, because as I have found, there is always someone smarter; there is always someone who, if they squint hard enough, will have seen something like your problem before; there is always a better way to do it, it's just that no-one else may have discovered it yet.

Community
  • 1
  • 1
theheadofabroom
  • 15,961
  • 5
  • 29
  • 63
  • @BiggAI thanks for the very detailed answer. We need an answer for No. 4. In general you're right and using REST could be our solution, but most of the websites we want to streamline the interaction with don't have a REST API. As for the interaction with the iFrame we solved that already with a browser extension. – Guy Korland Feb 06 '13 at 14:36
  • Please feel free to answer your own question if you have solved your issue. – theheadofabroom Feb 20 '13 at 07:41
  • I didn't find any good framework, I just wrote a javascript that does it. – Guy Korland Feb 20 '13 at 08:23
  • then surely the explanation of how you did that is your answer? The point of StackOverflow is not so much to have one or more users answer the questions of one other user, but to build a repository of information that might be useful to many many users into the future - [The Wikipedia of long-tail programming questions](http://blog.stackoverflow.com/2011/01/the-wikipedia-of-long-tail-programming-questions/) – theheadofabroom Feb 20 '13 at 10:20
  • Perhaps you're right I will do it next time, @Will set it as "closed as not a real question by" – Guy Korland Feb 20 '13 at 15:55