IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Test Discussion :

[Selenium IDE] : fenêtre Firefox


Sujet :

Test

  1. #1
    Membre averti
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juin 2014
    Messages
    744
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Juin 2014
    Messages : 744
    Points : 336
    Points
    336
    Par défaut [Selenium IDE] : fenêtre Firefox
    Bonjour.
    J'utilise Selenium IDE
    J'ai un problème avec le choix de la fenêtre, mon test ouvre une nouvelle fenêtre mais la suite des interactions avec le navigateur se fait sur la première page.
    Comment faire pour forcer Selenium à aller sur la fenêtre souhaitée ou le forcer à ouvrir la nouvelle url dans la fenêtre initiale ?
    Merci de votre aide.

  2. #2
    Membre averti
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juin 2014
    Messages
    744
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Juin 2014
    Messages : 744
    Points : 336
    Points
    336
    Par défaut
    Bonjour.
    Je travaille avec Selenium IDE qui génére un fichier html
    Mon problème qu'à un moment donné, il ouvre une nouvelle page mais garde le focus sur la premiere.
    Si je fais :
    Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    <tr>
    	<td>selectWindow</td>
    	<td>title=mapage</td>
    	<td></td>
    </tr>

    ça marche le soucis est que ce titre est généré dynamiquement (et change souvent).


    La doc IDE lorsque je clique sur Référence me donne les infos ci-dessous.
    Mais je suis incapable de trouver le windowID.

    Pouvez vous m'aider ?



    SelectWindow(windowID)
    Arguments:
    • windowID - the JavaScript window ID of the window to select
    Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.
    Window locators provide different ways of specifying the window object: by title, by internal JavaScript "name," or by JavaScript variable.
    • title=My Special Window: Finds the window using the text that appears in the title bar. Be careful; two windows can share the same title. If that happens, this locator will just pick one.
    • name=myWindow: Finds the window using its internal JavaScript "name" property. This is the second parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) (which Selenium intercepts).
    • var=variableName: Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using "var=foo".
    If no window locator prefix is provided, we'll try to guess what you mean like this:
    1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).
    2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method.
    3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".
    4.) If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". Since "title" is not necessarily unique, this may have unexpected behavior.
    If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages like the following for each window as it is opened:
    debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"
    In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").

  3. #3
    Membre averti
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juin 2014
    Messages
    744
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Juin 2014
    Messages : 744
    Points : 336
    Points
    336
    Par défaut
    Bonjour.
    J'avance doucement mais à nouveau, je tombe sur un os.
    Pour gérer le libellé du title de la page html, je fais faire saisir à l'utilisateur Jenkins la partie variable du non, en fait c'est le GoRoCo de la nouvelle version applicative qu'il veut tester (donc il le connait).
    Cette saisie va alimenter une variable : "Ce build a des paramètres ..."
    Cette variable va s'écrire dans un script js : "Executer un script shell / commande " :
    Code shell : Sélectionner tout - Visualiser dans une fenêtre à part
    cat 'var title = ["${GoRoCo}]" ' > fic.js
    Puis dans Selenium , on active l'option Selenium IDE extension comme décrit ici.

    Mon nouveau problème est que l'endroit où se trouve Jenkins et l'appli testée sont sur des machines distantes et qu'elles n'ont pas de navigateur d'installé.

    Comment transmettre les infos du fichier fic.js au script html joué par Jenkins ?

  4. #4
    Membre averti
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juin 2014
    Messages
    744
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Juin 2014
    Messages : 744
    Points : 336
    Points
    336
    Par défaut
    Visiblement impossible à faire avec Selenium IDE si il n'y a pas de navigateur sur la machine où est installée l'application.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Editer ses tests avec Selenium IDE
    Par Misaki dans le forum Test
    Réponses: 8
    Dernier message: 26/09/2011, 13h03
  2. [PHPUnit] Combiné à Selenium IDE/RC extension firefox ?
    Par bilred dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 19/03/2010, 15h14
  3. Selenium IDE ou iMacros ?
    Par Asterius dans le forum Test
    Réponses: 5
    Dernier message: 05/02/2010, 18h16
  4. Selenium IDE/RC extension firefox
    Par nico33410 dans le forum Autres langages pour le Web
    Réponses: 5
    Dernier message: 17/11/2008, 16h03
  5. [test] étendre selenium ide
    Par tiger33 dans le forum Autres
    Réponses: 1
    Dernier message: 30/08/2007, 12h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo