This is a migrated thread and some comments may be shown as answers.

How to verify the excel data in coded step

3 Answers 173 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Y
Top achievements
Rank 1
Y asked on 26 Feb 2014, 09:12 AM
Hi,Support

  I want to read and verify if the data in an excel certain column contains some specific text, and then go to next step
my step is

Assert.IsTrue(Data("ExpectRedirectUrl").ToString().Contains("http"))

"ExpectRedirectUrl" is the certain column in the excel,
"Http" is the specific text for verify.

Error message:

Line 84: (BC30516) Overload resolution failed because no accessible 'Contains' accepts this number of arguments.
Line 84: (BC30201) Expression expected.

Can you help to clarify??
Thanks.

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 26 Feb 2014, 02:04 PM
Hello,

The code looks correct and I verified it compiles just fine to me.

Asking Google it appeared this error is often hit in VB if you call method which argument don't match the signature. I suspect you got the error then fixed the code but for some reason you still get it? Is this a local run (quick execute) you get this from? If so you can try deleting the .DLL from the project bin folder and run the test again.

Regards,
Konstantin Petkov
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Y
Top achievements
Rank 1
answered on 27 Feb 2014, 02:36 AM
Yes, I ran by clicking the 'Start' icon in the toolbar, is it the 'quick start' you mean?
For you suggestion to delete .dll files under bin folder, there are so many .dll files. So I prefer not.
Is there any other solutions? or another way to execute that can avoid this?

Today, I run it again thru the test list execution option, and It seems the method I used incorrect.

The complete sentence is 

  If  (Assert.IsTrue(Data("ExpectRedirectUrl").ToString().Contains("http"))) then


The compilation error for this line is 
WebTest.tstest.vb: Line 84: (BC30491) Expression does not produce a value


Will you please help to check what's the problem now?
Thanks 1 lot.
0
Y
Top achievements
Rank 1
answered on 27 Feb 2014, 07:05 AM
Hi,Support

   I found the problem, contains method has already returned Boolean, the isTrue method doesn't need any more.

  The code below works.

      If  (Data("ExpectRedirectUrl").ToString().Contains("http")) then


Thanks all the same.

Tags
General Discussions
Asked by
Y
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Y
Top achievements
Rank 1
Share this question
or