Value extracted from html table

26 views
Skip to first unread message

Usman afzal

unread,
Jul 30, 2013, 9:13:06 PM7/30/13
to seleniu...@googlegroups.com

Hi,

I am trying to extract a value which is in integer form i.e 60.
I have a code that is going through each row and each column and then using getText() method retrieve the value from column.

When applying testNG assertEqual,the value is not matched as the value found is "[60 ]" instead of "[60]".
 
Output of trace: 
The Text is 60
Exception in thread "main" java.lang.AssertionError: expected [60] but found [60 ]
    at org.testng.Assert.fail(Assert.java:94)
    at org.testng.Assert.failNotEquals(Assert.java:494)
    at org.testng.Assert.assertEquals(Assert.java:123)
    at org.testng.Assert.assertEquals(Assert.java:165)
    at rough.Test.main(Test.java:83)


Can someone help me finding how i can fix the assertion?


Regards
Usman

Mark Collin

unread,
Jul 31, 2013, 4:25:51 AM7/31/13
to seleniu...@googlegroups.com
Show us your code and we may be able to help
> --
> You received this message because you are subscribed to the Google
> Groups "Selenium Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to selenium-user...@googlegroups.com.
> To post to this group, send email to seleniu...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/selenium-users/CABqGbB-MqHrghJ3Fp%3Dwwzp72B6Fpbf3d1tz_qySJDRTossbFEg%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Sivakumar K

unread,
Jul 31, 2013, 5:17:05 AM7/31/13
to seleniu...@googlegroups.com

Looks like extra space found in [60 ], so trim the space.


On Wed, Jul 31, 2013 at 9:25 AM, Mark Collin <mark....@lazeryattack.com> wrote:
Show us your code and we may be able to help


On 31/07/2013 02:13, Usman afzal wrote:

Hi,

I am trying to extract a value which is in integer form i.e 60.
I have a code that is going through each row and each column and then using getText() method retrieve the value from column.

When applying testNG assertEqual,the value is not matched as the value found is "[60 ]" instead of "[60]".

Output of trace:
The Text is 60
Exception in thread "main" java.lang.AssertionError: expected [60] but found [60 ]
    at org.testng.Assert.fail(Assert.java:94)
    at org.testng.Assert.failNotEquals(Assert.java:494)
    at org.testng.Assert.assertEquals(Assert.java:123)
    at org.testng.Assert.assertEquals(Assert.java:165)
    at rough.Test.main(Test.java:83)


Can someone help me finding how i can fix the assertion?


Regards
Usman
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/51F8CA0F.7080906%40lazeryattack.com.

Usman afzal

unread,
Jul 31, 2013, 7:21:38 AM7/31/13
to seleniu...@googlegroups.com
Thanks everyone,i have trim the space and it is working fine.
Thanks once again for help.

Regards
Usman


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CACPQJMK1x_hxFKp32P%3D2g5fS31hFTXtOS4HoH7sGu-pzDEuvcA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages