Перейти к содержимому

Aleksey.Vlasov

Регистрация: 03 окт 2013
Offline Активность: 06 ноя 2015 07:44
-----

Мои сообщения

В теме: Подскажите, как проверить с помощью selenium IDE css элементы?

26 июня 2015 - 10:50

<tr>
    <td>verifyEval</td>
    <td>window.getComputedStyle(window.document.getElementById('id-элемента'),null).getPropertyValue('background-color');</td>
    <td>rgb(251, 251, 251)</td>
</tr>

 

или

 

<tr>
    <td>storeEval</td>
    <td>window.getComputedStyle(window.document.querySelector('css селектор')).getPropertyValue('border-top-color');</td>
    <td>rgb</td>
</tr>

<tr>
    <td>echo</td>
    <td>${rgb}</td>
    <td></td>
</tr>


В теме: Копирование/вставка текста

03 июня 2015 - 13:54

Простейший вариант. Всё зависит откуда будет этот текст копироваться (текстовое поле, текстовая строка и прочее).

<tr>
    <td>storeText</td>
    <td>locator</td>
    <td>variableName</td>
</tr>
<tr>
    <td>type</td>
    <td>locator</td>
    <td>${variableName}</td>
</tr>


В теме: Перестала выполняться команда type в selenium IDE

12 февраля 2015 - 07:03

Воспроизведение теста происходит прям в Selenium IDE или всё-таки запуск через запущенный в терминале (командной строке) selenium-server?

У меня тоже ошибка не воспроизводится. Всё работает как часы.


В теме: Перестала выполняться команда type в selenium IDE

04 февраля 2015 - 14:40

Какая версия selenium ide и ff? В хроме пробовали?


В теме: user-extensions.js и sideflow.js - Как подключить оба в selenium serve

04 февраля 2015 - 14:31

Пропиши эти строчки прям в подключаемый user-extensions.js

/*********************START OF FLOWCONTROL EXTENSION*******************/

function map_list( list, for_func, if_func )
{
    var mapped_list = [];
    for ( var i = 0; i < list.length; ++i )
    {
        var x = list[i];
        if( null == if_func || if_func( i, x ) ) 
            mapped_list.push( for_func( i, x ) );
    }
    return mapped_list;
}

    
// Modified to initialize GoTo labels/cycles list
HtmlRunnerTestLoop.prototype.old_initialize = HtmlRunnerTestLoop.prototype.initialize;

HtmlRunnerTestLoop.prototype.initialize = function(htmlTestCase, metrics, seleniumCommandFactory) {
    this.gotoLabels  = {};
    this.whileLabels = { ends: {}, whiles: {} };
    
    this.old_initialize(htmlTestCase, metrics, seleniumCommandFactory);
    
    this.initialiseLabels();
};

HtmlRunnerTestLoop.prototype.initialiseLabels = function() {
    var command_rows = map_list( this.htmlTestCase.getCommandRows() 
                               , function(i, x) { 
                                    return x.getCommand()
                                    }
                               );

    var cycles = [];
    for( var i = 0; i < command_rows.length; ++i )
    {
        switch( command_rows[i].command.toLowerCase() )
        {
            case "label":
                this.gotoLabels[ command_rows[i].target ] = i;
                break;
            case "while":
            case "endwhile":
                cycles.push( [command_rows[i].command.toLowerCase(), i] )
                break;
        }
    }        
        
    var i = 0;
    while( cycles.length )
    {
        if( i >= cycles.length )
            throw new Error( "non-matching while/endWhile found" );
            
        switch( cycles[i][0] )
        {
            case "while":
                if(( i+1 < cycles.length ) && ( "endwhile" == cycles[i+1][0] ))
                {
                    // pair found
                    this.whileLabels.ends[ cycles[i+1][1] ] = cycles[i][1]
                    this.whileLabels.whiles[ cycles[i][1] ] = cycles[i+1][1]
                    
                    cycles.splice( i, 2 );
                    i = 0;
                }
                else
                    ++i;
                break;
            case "endwhile":
                ++i;
                break;
        }
    }
                    
};    

HtmlRunnerTestLoop.prototype.continueFromRow = function( row_num ) {
    if(    row_num == undefined
        || row_num == null
        || row_num < 0
        )
        throw new Error( "Invalid row_num specified." );
        
    this.htmlTestCase.nextCommandRowIndex = row_num;
};
    


// do nothing. simple label
Selenium.prototype.doLabel      = function(){};

Selenium.prototype.doGotolabel  = function( label ) {

    if( undefined == htmlTestRunner.currentTest.gotoLabels[label] ) 
        throw new Error( "Specified label '" + label + "' is not found." );
    
    htmlTestRunner.currentTest.continueFromRow( htmlTestRunner.currentTest.gotoLabels[ label ] );
};
    
Selenium.prototype.doGoto = Selenium.prototype.doGotolabel;


Selenium.prototype.doGotoIf = function( condition, label ) {
    if( eval(condition) ) 
        this.doGotolabel( label );
};


    
Selenium.prototype.doWhile = function( condition ) {
    if( !eval(condition) )
    {
        var last_row = htmlTestRunner.currentTest.htmlTestCase.nextCommandRowIndex - 1
        var end_while_row = htmlTestRunner.currentTest.whileLabels.whiles[ last_row ]
        if( undefined == end_while_row ) 
            throw new Error( "Corresponding 'endWhile' is not found." );
        
        htmlTestRunner.currentTest.continueFromRow( end_while_row + 1 );
    }
};


Selenium.prototype.doEndWhile = function() {
    var last_row = htmlTestRunner.currentTest.htmlTestCase.nextCommandRowIndex - 1
    var while_row = htmlTestRunner.currentTest.whileLabels.ends[ last_row ]
    if( undefined == while_row ) 
        throw new Error( "Corresponding 'While' is not found." );
    
    htmlTestRunner.currentTest.continueFromRow( while_row );
};
    
/***********************************END OF FLOWCONTROL************************/