Sideex Recorder - Alternative recorder to Selenium IDE

141 views
Skip to first unread message

Nagendra Kuppala

unread,
Jun 6, 2018, 10:32:56 PM6/6/18
to Selenium Users
Hello,

Is anyone here using Sideex recorder (Open Source) for creating test cases? Sideex is an extended  Selenium IDE recorder which work on latest browser versions like FF 55+.
I have imported the source code for the recorder which is written in javascript from github, so that I can add new features as per my requirement.
I'm having trouble  working with it. 
Is there anyone using Sideex ? I need help in javascript and jquery to make changes to the recorder code. Any help?

Thanks in advance.

David

unread,
Jun 8, 2018, 11:23:43 AM6/8/18
to Selenium Users
What specific help do you need?

Nagendra Kuppala

unread,
Jun 8, 2018, 11:34:08 AM6/8/18
to Selenium Users
I have web application with webix, which means the elements ID's of the web page will dynamically changes every time I login to the application. So, that is making my test case execution to fail because by default the recorder is selecting find element by ID target as the Selenium IDE element target values preferred order is ID, Name, Link, CSS and xPath. 

Current execution scenario : (If not familiar with Selenium IDE refer: https://www.youtube.com/watch?v=ST1Z_bvUcYc) 1. Recorder records a test case by clicking "Record" button. 2. Play back the test case by clicking on "Play or Play Suite or Play All" button. (Test case executes with the selected/shown target value)

Expected execution scenario: 1. No change. (same as step-1 of current execution scenario) 2. Play back the test case by clicking on "Play or Play Suite or Play All" button. (Execute test case by looping through all the available Element Target Values like (ID, Name, Link, CSS, Xpath) before test case fail due element not found exception).

If in case the element target 'ID' changed while test case play back, loop and look for next alternative element target selector (Target dropdown) 'Name' --> 'Link' --> etc . Before sending 'Element not found' error and Test case fail. If all the alternative element targets are really not found then throw 'Element not found' error and Test case fail.

David

unread,
Jun 8, 2018, 5:11:10 PM6/8/18
to Selenium Users
That sounds like bad feature/functional design in the IDE? As a start submit an issue/bug for it. You can then submit a pull request to fix it when you get things working to resolve this. For the issue/bug, you could also ask (so that the IDE developers can respond) what might be the best approach to fix it.

It sounds like you have idea functionally for a solution but you don't know how to implement it? This may be out of scope for a forum post and is a project unto itself. Better discussed on IDE's Github issue instead.

Anyone interested in helping you (here) should probably private message you to not clutter up the discussion thread if things get long in discussion over time.

On a related note, you wouldn't have this problem if you use the code/script based approach to Selenium rather than using the IDE. e.g. at least export IDE recording to code, edit code to desire, then run as code from your language's test framework. That gives you more control for what to do with element locators.

Nagendra Kuppala

unread,
Jun 11, 2018, 1:30:26 PM6/11/18
to Selenium Users
Hi David,

Thank you the response. I have already fix the problem in the back end using web driver code base.
I need the same issue fixed in Selenium IDE/ SideeX recorder as our Manual Testers or a application support members use the Recorder to create Test cases and play back. As they do not have any coding knowledge, I have to make it work in Recorder as well.
Tried to fix it with my basic javascript experience and I came to know the function I'm using to locate element is written asynchronously. I believe any guy having good knowledge on JS and Jquery would fix the issue.

Yes, I will submit a issue/bug in Github issues, at the same time I do not have much time to wait for their response as they have stopped supporting IDE (I don't know if they would even consider responding).

That is the reason I'm looking for any help from here.

Thanks

David

unread,
Jun 12, 2018, 6:10:36 PM6/12/18
to Selenium Users
Based on your last response, maybe others can better help you if you point out the section or area of code (and file(s) involved) in the IDE in question (narrow down the problem). We can then suggest how to fix it asynchronously. Otherwise, you're expecting others to skim through the IDE's codebase to track down the issue and a fix for it.

Nagendra Kuppala

unread,
Jun 12, 2018, 6:37:00 PM6/12/18
to Selenium Users
Here is the code I'm using to locate the element present or not in DOM before passing it to doCommand() function to execute.

These functions are executing asynchronously. --> Solution, Make required code changes for a Synchronous execution (May be using JQuery selectors and Queue iteration instead of array loop.)

var targetValue = "";
var rv = false;

// iterate through all available Targets (for ex: ID, NAME, Link, CSS, XPath) return Target to doCommand().
function passTargetValue(cmd){
 
try{

// getTarget() returns all available element Target with a " ; " delimiter
 let targetStr
=  getTarget(cmd);          // example targetstr = id=123;name=abc;link=ggle;css=#123;xpath=//html/body/div
         let commandTargetStr
= targetStr.split(";");
       
if(commandTargetStr.length === 1){
         targetValue
= commandTargetStr;
         ctri_log
.info("targetValue open: " + targetValue );  
         
return;
       
}
//iterate through all available Targets (for ex: ID, NAME, Link, CSS, XPath)
       
for (var i = 0; i < commandTargetStr.length; i++) {
     tv
= commandTargetStr[i];
     ctri_log
.info("targetValue: " + tv );


// Passing Target to locate element present or not.
     selectValidTarget
(tv);
     ctri_log
.info("rv = " +rv);
   
if (rv){
  targetValue
= tv;
   
return;
   
}else{
  passTargetValue
(cmd);
   
}
   
}
 
}
 
catch(error) {
       
if(error.message == "Could not establish connection. Receiving end does not exist.") {
        sendPreparedNextFrame
(infos);
       
} else {
            ctri_log
.error("Unknown error");
       
}
   
}
 
}



// Validates element present or not using the passed TargetValue
function selectValidTarget(tv){  
 
try{
        browser
.tabs.query({
            active
: true,
            windowId
: contentWindowId
       
}).then(function(tabs) {
           
if (tabs.length === 0) {
                console
.log("No match tabs");
           
} else {
                browser
.webNavigation.getAllFrames({tabId: tabs[0].id})
                   
.then(function(framesInfo){
                       
var frameIds = [];
                       
for (let i = 0; i < framesInfo.length; i++) {
                            frameIds
.push(framesInfo[i].frameId)
                       
}
                        frameIds
.sort();
                       
var infos = {
                           
"index": 0,
                           
"tabId": tabs[0].id,
                           
"frameIds": frameIds,
                           
"targetValue": tv
                       
};
                        sendShowElementMessage
(infos);
                   
});
           
}
       
});
   
} catch (e) {
        console
.error(e);
   
}
}


function validateTarget(infos){
 browser
.tabs.sendMessage(infos.tabId, {
         showElement
: true,
         targetValue
: infos.targetValue
     
}, {
         frameId
: infos.frameIds[infos.index]
     
}).then(function(response) {
         
if (response){
             
if (!response.result) {
             sendPreparedNextFrame
(infos);
             
} else {
                 let text
= infos.index == 0 ? "top" : index.toString() + "(id)";
                 ctri_log
.info("Element is found in " + text + " frame.");
                 rv
= true;
             
}
         
}
     
}).catch(function(error) {
         
if(error.message == "Could not establish connection. Receiving end does not exist.") {
         sendPreparedNextFrame
(infos);
         
} else {
             ctri_log
.error("Unknown error");
         
}
     
});
 
}


function sendPreparedNextFrame(infos) {
   
if (infos.index == infos.frameIds.length) {
        ctri_log
.error("Element is not found.");
        rv
= false;
   
} else {
        infos
.index++;
        validateTarget
(infos);
   
}
}




function doCommand() {

Command = Command;
Target = passTargetValue(cmd);
Value = value;
// Executes the command line --> input --> (Command , Target , Value)


}


Thanks.
Reply all
Reply to author
Forward
0 new messages