Error during using Selblocks in Selenium IDE - selenium

I have a problem with Selblocks extension to Selenium IDE. I've prepare XML file:
<testdata>
<vars projekt="1-2OM0W5"/>
<vars projekt="1-2P3K19"/>
<vars projekt="1-2P2O6L"/>
<vars projekt="1-2P00UN"/>
<vars projekt="1-2OW20F"/>
</testdata>
Selenium is taking first value from XML correctly. Unfortunately after endForXml command I have such error:
[error] Unexpected Exception: TypeError: activeBlockStack(...).top(...) is undefined.
`<tr>
<td>loadTestData</td>
<td>file://C://Users//mkulesza//Desktop//14.4 RELEASE/new 10.xml</td>
<td></td>
</tr>
<tr>
<td>while</td>
<td>!testdata.EOF()</td>
<td></td>
</tr>
<tr>
<td>nextTestData</td>
<td></td>
<td></td>
</tr>
<tr>
<td>store</td>
<td></td>
<td>klient</td>
</tr>
<tr>
<td>store</td>
<td></td>
<td>wycena_clnet</td>
</tr>
<tr>
<td>store</td>
<td></td>
<td>numer</td>
</tr>
<tr>
<td>open</td>
<td>http://clnet-prp/Main.aspx</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=FindMenu1_btnCosting</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>id=AssignedTo_chosen</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/form/fieldset/div[2]/table[2]/tbody/tr/td[1]/table/tbody/tr[1]/td[2]/div/div/div/ul/li[contains(.,"wszy")]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=QuotaId</td>
<td>${projekt}</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnForm</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>2000</td>
<td></td>
</tr>
<tr>
<td>storeText</td>
<td>xpath=html/body/table[2]/tbody/tr/td/div/fieldset/div/div/div/div/table/tbody/tr/td[1]</td>
<td>numer</td>
</tr>
<tr>
<td>echo</td>
<td>${numer}</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=${projekt}</td>
<td>link=${projekt}</td>
</tr>
<tr>
<td>clickAt</td>
<td>id=assignedTo_chosen</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/form[1]/fieldset/div/div[2]/div[3]/div/div[2]/div/div/div/ul/li[contains(.,"CLNET_TEST_PM")]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=btnChangeAssigment</td>
<td></td>
</tr>
<tr>
<td>refreshAndWait</td>
<td></td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>id=ActionPerformed</td>
<td>Zaakceptuj do wyceny (Accepted)</td>
</tr>
<tr>
<td>type</td>
<td>id=comment</td>
<td>Test Comment</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnPerformAction</td>
<td></td>
</tr>
<tr>
<td>storeText</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/fieldset[2]/div/table/tbody/tr/td[1]/div/div[2]/span</td>
<td>klient</td>
</tr>
<tr>
<td>echo</td>
<td>${klient}</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>${wycena_clnet}</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>https://solver/test/DataDigger/Public/index.php</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//ul[#id='menu-content-5']/li/p</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>6000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>xpath=/html/body/div[5]/div/div[2]/button[1]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=QuoteIdShow</td>
<td>${numer}</td>
</tr>
<tr>
<td>sendKeys</td>
<td>name=QuoteIdShow</td>
<td>${KEY_DOWN}</td>
</tr>
<tr>
<td>pause</td>
<td>2000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[contains(text(), '${numer} ${klient}')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=realSelection</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>xpath=/html/body/div[5]/div[2]/div[2]/div[3]/button[1]</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Jesteś pewien, że chcesz dodać?</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>xpath=/html/body/div[5]/div[2]/div[2]/div[2]/div/div[1]/div[1]/div/div[2]/div/div/div/table/tfoot/tr/th[1]/div/button[2]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>xpath=/html/body/div[5]/div[2]/div[2]/div[2]/div/div[1]/div[1]/div/div[2]/div/div/div/table/tbody/tr[2]/td[2]/div/div[1]/dd/input</td>
<td>DATERA</td>
</tr>
<tr>
<td>sendKeys</td>
<td>xpath=/html/body/div[5]/div[2]/div[2]/div[2]/div/div[1]/div[1]/div/div[2]/div/div/div/table/tbody/tr[2]/td[2]/div/div[1]/dd/input</td>
<td>${KEY_DOWN}</td>
</tr>
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>xpath=/html/body/div[5]/div[2]/ul[9]/li[3]/a[contains(text(), 'DATERA Call-eX brama GSM x 4')]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>xpath=/html/body/div[5]/div[2]/div[2]/div[2]/div/div[1]/div[1]/div/div[2]/div/div/div/table/tbody/tr[2]/td[3]/div/div[1]/dd/textarea[2]</td>
<td>TEST</td>
</tr>
<tr>
<td>click</td>
<td>css=.SaveUpdateButton</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Jesteś pewien, że chcesz zapisać zmiany?</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>http://clnet-prp/Main.aspx</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>id=FindMenu1_btnCosting</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=FindMenu1_btnCosting</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>id=AssignedTo_chosen</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/form/fieldset/div[2]/table[2]/tbody/tr/td[1]/table/tbody/tr[1]/td[2]/div/div/div/ul/li[contains(.,"wszy")]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=QuotaId</td>
<td>${projekt}</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnForm</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=${projekt}</td>
<td>link=${projekt}</td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>id=costingSystemId</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=costingSystemId</td>
<td>${numer}v1</td>
</tr>
<tr>
<td>click</td>
<td>id=btnChangeAssigment</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>id=ActionPerformed</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>id=ActionPerformed</td>
<td>Wyślij wycenę (Completed)</td>
</tr>
<tr>
<td>type</td>
<td>id=comment</td>
<td>Zamknieto w CLNET</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnPerformAction</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/form/fieldset/div[2]/button[1]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>xpath=/html/body/table[2]/tbody/tr/td/div/form/fieldset/div[2]/button[1]</td>
<td></td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
</tbody></table>
</body>
</html>`
No idea what is wrong.
Thanks for help

Related

Data Driven Selenium with TFS

I am trying to get Selenium to be Data Driven with Microsoft TFS. I understand Selenium IDE but from what I've researched Selenium IDE cannot be used with a data driven format. What I'm trying to have the data driven section do is cycle through the repositories and add different TFS team and permissions to them. I can set up what I want in Selenium IDE but have no idea how to make it data driven with an excel sheet. Here is my HTML Source Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://MyTFS/" />
<title>DragAndDropPrologue</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">DragAndDropPrologue</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/tfs/DefaultCollection/XO/_build</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>6000</td>
<td>6000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//label[text()="Repo1;]/</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>link=Edit</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>xpath=//span[text()='Add build step...']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>xpath=(//button[#value='Add'])[11]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>xpath=(//button[#value='Add'])[12]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=ok</td>
<td></td>
</tr>
<tr>
<td>dragAndDropToObject</td>
<td>//div[text()="Fetch the Quality Profile from SonarQube"]/</td>
<td>//div[text()="Ant"]/</td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>type</td>
<td>css=div.wrap > input[type="text"]</td>
<td>Sonar</td>
</tr>
<tr>
<td>type</td>
<td>id=projectKey</td>
<td>test</td>
</tr>
<tr>
<td>type</td>
<td>id=projectName</td>
<td>test</td>
</tr>
<tr>
<td>dragAndDropToObject</td>
<td>//div[text()="SonarQube for MSBuild - End Analysis"]/</td>
<td>//div[text()="Ant"]/</td>
</tr>
<tr>
<td>click</td>
<td>xpath=//span[text()='Save']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>id=ok</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//label[text()="Repo2;]/</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>link=Edit</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>xpath=//span[text()='Add build step...']</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
<tr>
<td>click</td>
<td>xpath=(//button[#value='Add'])[11]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>xpath=(//button[#value='Add'])[12]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=ok</td>
<td></td>
</tr>
<tr>
<td>dragAndDropToObject</td>
<td>//div[text()="Fetch the Quality Profile from SonarQube"]/</td>
<td>//div[text()="Ant"]/</td>
</tr>
<tr>
<td>type</td>
<td>css=div.wrap > input[type="text"]</td>
<td>Sonar</td>
</tr>
<tr>
<td>type</td>
<td>id=projectKey</td>
<td>test</td>
</tr>
<tr>
<td>type</td>
<td>id=projectName</td>
<td>test</td>
</tr>
<tr>
<td>dragAndDropToObject</td>
<td>//div[text()="SonarQube for MSBuild - End Analysis"]/</td>
<td>//div[text()="Ant"]/</td>
</tr>
<tr>
<td>click</td>
<td>xpath=//span[text()='Save']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=ok</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td>1000</td>
</tr>
</tbody></table>
</body>
</html>

How can i verify text present in Selenium IDE?

I have a form to check code Order in which I put "phone number" to search.
In a result list, I use verifyTextPresent to verify the value, but it fails.
Here is my link https://ventomarme55.bizwebvietnam.net/apps/kiem-tra-don-hang
and here my code:
<tr>
<td>open</td>
<td>https://ventomarme55.bizwebvietnam.net/apps/kiem-tra-don-hang</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>name=CheckType</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=PhoneNumber</td>
<td>0987610597</td>
</tr>
<tr>
<td>click</td>
<td>//button[#class='btn pull-right']</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Số điện thoại: 0987610597</td>
<td></td>
</tr>
Use Value for input
<tr>
<td>open</td>
<td>/apps/kiem-tra-don-hang</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>id=PhoneNumber</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=PhoneNumber</td>
<td>4141414</td>
</tr>
<tr>
<td>waitForValue</td>
<td>id=PhoneNumber</td>
<td>4141414</td>
</tr>
<tr>
<td>verifyValue</td>
<td>id=PhoneNumber</td>
<td>4141414</td>
</tr>

Selenium IDE requires 2 identical commands for button press

Here is an exerpt from my Selenium script
<tr>
<td>storeElementPresent</td>
<td>css=a.btn.btn-style-c[href="/shortlist/Remove/${codeparc}"]</td>
<td>isSelected</td>
</tr>
<tr>
<td>echo</td>
<td>${isSelected}</td>
<td></td>
</tr>
<tr>
<td>gotoIf</td>
<td>${isSelected}==true</td>
<td>skipToRemoveFromShortlist</td>
</tr>
<tr>
<td>click</td>
<td>css=a.btn.btn-style-c[href="/shortlist/Add/${codeparc}"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=a.btn.btn-style-c[href="/shortlist/Add/${codeparc}"]</td>
<td></td>
</tr>
<tr>
<td>gotoLabel</td>
<td>endOfShortlisting</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>skipToRemoveFromShortlist</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=a.btn.btn-style-c[href="/shortlist/Remove/${codeparc}"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=a.btn.btn-style-c[href="/shortlist/Remove/${codeparc}"]</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>endOfShortlisting</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=cboxClose</td>
<td></td>
</tr>
Commands 4 and 5 are duplicates
Commands 8 and 9 are duplicates
In step through mode if I execute the command twice it works fine.
Test page for you to look at - www.eurocamp.co.uk/pa012

How to manipulate the 'value' in selenium IDE?

The Scenario is,
I recorded the task, which is,
Login, edit a field and save it with different name(but the original field remains),logout.
Here i need to manipulate the 'name' field, so i can get 100 or more copies of it, with unique names.
Is it possible in Selenium IDE?, if not , is there any open source tool available to do the same?
</thead><tbody>
<tr>
<td>open</td>
<td>/SurveyHome.aspx</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=ctl00_ContentPlaceHolder1_gvSurvey_ctl02</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=ctl00_ContentPlaceHolder1_txtsurname</td>
<td>Survey 1</td> // This is the name of the survey.
</tr>
<tr>
<td>clickAndWait</td>
<td>id=ctl00_ContentPlaceHolder1_btncopysurok</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>id=ctl00_ContentPlaceHolder1_btncopyok</td>
<td></td>
</tr>
</tbody></table>
How to use the while loop in this code, i tried using but, the selenium ide is not recognising it.Can you plz help me with this..
You can use while loop for your purpose
<tr>
<td>getEval</td>
<td>index = 1;</td>
<td></td>
</tr>
<tr>
<td>while</td>
<td>index < 10;</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>index</td>
<td>value</td>
</tr>
<tr>
<td>echo</td>
<td>survey ${value}</td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>index++;</td>
<td></td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
in the name text box field you give the value has survey ${value},
now you can create any number of form with unique name by
using this while loop put your form inside this while loop.
Try it
Thank you.
<tr>
<td>open</td>
<td>/SurveyHome.aspx</td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>index = 1;</td>
<td></td>
</tr>
<tr>
<td>while</td>
<td>index < 100;</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>index</td>
<td>value</td>
</tr>
<tr>
<td>echo</td>
<td>survey ${value}</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=ctl00_ContentPlaceHolder1_gvSurvey_ctl02</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=ctl00_ContentPlaceHolder1_txtsurname</td>
<td>survey ${value}</td>
</tr>
<tr>
<td>click</td>
<td>id=ctl00_ContentPlaceHolder1_btncopyok</td>
<td></td>
</tr>
<tr>
<td>getEval</td>
<td>index++;</td>
<td></td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
try it.
thank you

Cannot execute a Selenium IDE test case for a Pop Window

Hi can any one please help me with this script please.
I cannot run a test case for pop window with selenium IDE.
here is the following script i am using to run the test case.
<tr>
<td>open</td>
<td>/car-insurance</td>
<td></td>
</tr>
<tr>
<td>assertTitle</td>
<td>Car Insurance | Netpig Insurance</td>
<td></td>
</tr>
<tr>
<td>clickAt</td>
<td>//img[#alt='Get an insurance quote']</td>
<td></td>
</tr>
<tr>
<td>selectPopUpAndWait</td>
<td>GetaCarInsurancequote</td>
<td>30000</td>
</tr>
<tr>
<td>selectWindow</td>
<td>null</td>
<td></td>
</tr>
<tr>
<td>assertTitle</td>
<td>Car Insurance | Netpig Insurance</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>form1:txt_4_3_0_Policy_CoverDate</td>
<td>26</td>
</tr>
<tr>
<td>type</td>
<td>form1:txt_4_4_0_Policy_CoverDate</td>
<td>05</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtRegLookup</td>
<td>VN05XVO</td>
</tr>
<tr>
<td>click</td>
<td>form1:imgGetVehicle</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVehicleYearOfManufacture</td>
<td>label=2006</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVehicleModified</td>
<td>label=Select</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVehicleModified</td>
<td>label=No</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtPurchaseDateDay</td>
<td>10</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtPurchaseDateMonth</td>
<td>02</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtPurchaseDateYear</td>
<td>2009</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtVehicleEstimatedValue</td>
<td>2001</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVehicleNightLocation</td>
<td>label=Car Park</td>
</tr>
<tr>
<td>type</td>
<td>form1:txtOvernightPostCode</td>
<td>wr51dh</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVehicleCoverType</td>
<td>label=Third Party Only</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboVolExcess</td>
<td>label=£300</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboNCBYears</td>
<td>label=9</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboNCBProtected</td>
<td>label=No</td>
</tr>
<tr>
<td>select</td>
<td>form1:cboNCBType</td>
<td>label=Motorcycle</td>
</tr>
if any one have some solution please email mail me on dhanunjayakumar#gmial.com
<tr>
<td>selectWindow</td>
<td>null</td>
<td></td>
</tr>
This piece looks problematic it should be like
<tr>
<td>selectWindow</td>
<td>name=NameOfPopupWindow</td>
<td></td>
</tr>
[error] Permission denied for http://www.netpig.co.uk to call method Location.toString on http://quotes.netpig.co.uk
Its Same Origin Policy Issue
Your popup window on http://www.netpig.co.uk is not allowed by browser to modify DOM on http://quotes.netpig.co.uk because its different domain.