Creating and storing a variable value

View: New views
3 Messages — Rating Filter:   Alert me  

Creating and storing a variable value

by Erick Akamine :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Can anyone tell me how do i create and store a value in a variable?

Basically, i have a HTML  a table and i want to compare a table cell value with another table cell value generated later.

First Generated Table(a.html)
<table border="1">            
<tr>
<td>teste
<td>erick</td>
</tr>
<tr>
<td>akamine</td>
<td>hirata</td>
</tr>
</table>

Second Generated table(b.html)
<table border="1">
<tr>
<td>teste2
<td>erick2</td>
</tr>
<tr>
<td>akamine2</td>
<td>hirata2</td>
</tr>
</table>

I want to store the value erick in the 1st table and later compare it with the value hirata2 in the 2nd table.

Thanks in advance.

Re: Creating and storing a variable value

by selenium704 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If both the tables are on the same page, then you can use 'getText' function to get the text and then use the command below to compare the text:
(String 1).equals(String 2)

Hope this helps you!


Erick Akamine wrote:
Hi,

Can anyone tell me how do i create and store a value in a variable?

Basically, i have a HTML  a table and i want to compare a table cell value with another table cell value generated later.

First Generated Table(a.html)
<table border="1">            
<tr>
<td>teste
<td>erick</td>
</tr>
<tr>
<td>akamine</td>
<td>hirata</td>
</tr>
</table>

Second Generated table(b.html)
<table border="1">
<tr>
<td>teste2
<td>erick2</td>
</tr>
<tr>
<td>akamine2</td>
<td>hirata2</td>
</tr>
</table>

I want to store the value erick in the 1st table and later compare it with the value hirata2 in the 2nd table.

Thanks in advance.

Re: Creating and storing a variable value

by tommy234 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


hi,
Check out solution your problem here
http://seleniumforum.forumotion.net/index.htm
bye

Erick Akamine wrote:
Hi,

Can anyone tell me how do i create and store a value in a variable?

Basically, i have a HTML  a table and i want to compare a table cell value with another table cell value generated later.

First Generated Table(a.html)
<table border="1">            
<tr>
<td>teste
<td>erick</td>
</tr>
<tr>
<td>akamine</td>
<td>hirata</td>
</tr>
</table>

Second Generated table(b.html)
<table border="1">
<tr>
<td>teste2
<td>erick2</td>
</tr>
<tr>
<td>akamine2</td>
<td>hirata2</td>
</tr>
</table>

I want to store the value erick in the 1st table and later compare it with the value hirata2 in the 2nd table.

Thanks in advance.