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>
Related
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
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>
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
Configuration Manifesting
Windows 7.
FireFox 22.
RAM 2 GB.
The following error occurs when we try to click on login button:-
[error] Unexpected Exception: fileName -> chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js, lineNumber -> 309, columnNumber -> 8
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://foxtel-cms.local/" />
<title>TC_4_RT</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">TC_4_RT</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=edit-name</td>
<td>qa_editor</td>
</tr>
<tr>
<td>type</td>
<td>id=edit-pass</td>
<td>qa_editor</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=edit-submit</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Foxtel Content(active tab)</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=TC_3_RT_148</td>
<td></td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Summary(active tab)</td>
<td>Summary(active tab)</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Overview</td>
<td>Overview</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Rotten Tomatoes</td>
<td>Rotten Tomatoes</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Edit</td>
<td>Edit</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Edit Genre</td>
<td>Edit Genre</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Edit Other Metadata</td>
<td>Edit Other Metadata</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Edit Synopsis</td>
<td>Edit Synopsis</td>
</tr>
<tr>
<td>verifyText</td>
<td>link=Revisions</td>
<td>Revisions</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Summary(active tab)</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Overview</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Rotten Tomatoes</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Edit</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Edit Genre</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Edit Other Metadata</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Edit Synopsis</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Revisions</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Log out</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
My Question:- Is there any solution for this error?
there is a fix (that works fine for my test case), see also http://code.google.com/p/selenium/issues/detail?id=5841: http://release.seleniumhq.org/selenium-ide/2.1.0/selenium-ide-2.1.0.xpi
This error is probably due to FF version 22. I uninstalled my FF 22 and reinstalled firefox 21 and it is working fine for me.
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