I want to display students in a repeat table called 'table1'. when the user click on one of them the details of the student enrollments will be displayed.
I ttried this, taking the index from the table then I compared the student id in the enrollment instance with the id in the students instance.
<xf:repeat nodeset="/instance('enrollInstance')/enrollment[Student_idStudent=student[index('table1')]/idStudent]">
nothing is displayed when I write this
<xf:output ref="Course_idCourse"/>
where Course_idCourse is an element in the enrollment
the xml file looks like this
</enrollment>
<Course_idCourse>1</Course_idCourse>
<Student_idStudent>2</Student_idStudent>
<year>2014</year>
<Semester>1</Semester>
<mark>50</mark>
<idEnrollment>1</idEnrollment>
</enrollment>
there is a student xml file that looks like this
<Student>
<idStudent />
</Student>
I appreciate your help.
The issue (based on that example XML) is that you are targeting a non-existant node. Looking at just this bit:
/enrollment[Student_idStudent=student[index('table1')]/idStudent]
You are looking for an enrollment node, that has a Student_idStudent child element, with a subsequent child idStudent element.
Yet in the example XML you have an enrollment element, with a Student_idStudent child element that contains text, but no child elements within it. So the Xpath will never match anything.
Related
I am trying to extract the Table which has the following format
When I want to extract i should have either put some character on place up icon or i dont want that either the case is fine..
But UIPath brings this way.. 78,59,237806 all as one text which is misleading.. How to resolve this issue..
Thanks
Take a look at the Find Children activity. You can specify an item via selector (the table) and use Find Children to return a collection of type UiElement.
So set the filter to extract the "<webctrl tag='tr' />" which will effectively give you a collection of the rows.
Use a For Each to iterate through each UiElement you got from the first Find Children activity, and use that element to run another Find Children. In this case, set the filter to extract the elements with a class of "mid-wrap". This gives you a collection of the elements in the row which match that requirement, and this will exclude the data-up value, since that's a different class.
You can then loop over this collection to get the innertext attribute, which will give you the actual values you're looking for each cell in the row. Use something like Add Data Row to add the values to a datatable, and let the For Each run over the next row in the collection.
I have a WebTable, which has some WebElements. I want to verify the text of one of the WebElements and take action on it. Can you help, how to proceed on this?
As Vinoth said if you know which row and column the element is in you can use ChildItem.
Typically UFT flattens the elements (so that a WebElement in a WebTable will appear as the WebTables sibling if both are added to the repository. However something that many people do not know is that if you manually put an element under the WebTable (or any other element) then UFT will look for it under the parent object.
This means that you can describe the nested element and UFT will only look under the table and not in the rest of the page.
Browser("B").Page("P").WebTable("T").WebElement("innertext:=.*bla.*").Click
You can use ChildItem method of WebTable.
Set MyWebElement = Browser("CreationTime:=0").Page("micclass:=Page").Webtable("name=TableName").ChildItem(Row, Column, micclass, Index)
Row - Required. A long integer value.
The row number where the cell is located. The first row in the table is numbered 1.
Column - Required. A long integer value.
The column number where the cell is located. The first column in the table is numbered 1.
MicClass - Required. A String value.
The object type.
Index - Required. A long integer value.
The index of the object of type MicClass in the cell. This index indicates the desired element when there is more then one object of type MicClass in the cell. The first object has an index of 0.
MyWebElement is the element you wanted. You can access any methods/properties of WebElement. For ex, to click,
MyWebElement.Click
I am trying to parse a CSV file as an input for my process.
I used the FilePoller to detect any changes, made in the .csv file. The poller is connected to the ParseData Activity which is referenced by the DataFormat Ressource, where I am defining the structure of my data. The output of ParseData is used in the RenderXML activity to create an xml string.
I am facing the issue, that I am not able to loop through each line in the CSV file to parse it to an XML document structure.
Do you have a resolution, how to implement this?
Please find the "Demo" process attached to this post.
Link to Process
Thank you in advance
Adrian
Select both the RenderXml and WriteFile activities. You can do that by clicking one, and then holding the Shift button while you click on the second.
Right-click over the selected activities, and select Create Group > Iterate. This will create an Iterate Scope around the two selected activities.
Click on the Properties panel and select the output of the ParseData activity as the Variable List through which you would like to iterate.
I hope this helps!
As per my understanding you are getting repeated element in Parse Data Output and these repeated element you want to map to render xml schema . Which is not allowed until and unless in schema you have element to which you want to map is of repeated type. If that element is of repeated type then map element from the right side to left side and select for each option. Then for every element in Parse data it will map to schema element.
Hope Your doubt get resolved.
I'm trying to create xpath expression which will work with selenium using following html snippet.
Below is table contains various row that gets incremented with uniquely generatedid(for example in following snippet that id is 1000).
Selenium has created following expressions when row of id 1000 was added in table. However instead of using id, I want to create xpath by using 3rd data element in row which is (MyName) in html snippet.
A possible suggestion is to not use xpath whenever possible.
http://saucelabs.com/blog/index.php/2011/05/why-css-locators-are-the-way-to-go-vs-xpath/
You need to convert the places in the XPATH where it is referring to the row by its ID to its relative position in the table.
In all of your XPATHs, you would change tr[#id='1000'] to tr[3]
Your first example XPATH would look liek this:
//tr[3]/td[1]/a[1]/img //tr[#id='1000']/td[1]/span/a/img
Your second example would follow similarly:
//tr[3]/td[1]/span/a/img
As would your third:
//tr[3]/td[1]/a[2]/img
Hopefully you are now able change the rest of them.
Assume that, a page contains a table of records (created dynamically) with Delete, Edit and View options (for each row/record). Now i want to find a specific record with name/id and delete that record. Is this possible in Selenium?
Help me to resolve this! Thanks in Advance.
Sure, we do this all the time in our tests. You need to write an element locator that finds the row you want and identifies the appropriate button, then just Selenium.Click(...) on it. The exact locator value will depend on your application, but it will probably be something like xpath=//path/to/table/tr[td[pos() = 1 AND text() = 'My Name']]/td/button[#value='Delete']. In other words, "the button with the value 'Delete' in the row that has 'My Name' in its first cell in the table".