Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

C# Anti-Forgery error!?

View previous topic View next topic Go down

C# Anti-Forgery error!?

Post by l3l00 on Mon Feb 23, 2015 10:56 pm

Wrote a test case that goes to a Microsoft Sharepoint site, it goes into the iFrame box.
In the iFrame there is a table and a search functionality. I grab the SSN number of the first entry and paste it into the search box, then I have selenium Click the search button.

After that, I get an anti-forgery error!? I have a method that checks for a YSOD (Yellow Screen of Death):
Assert.AreEqual("Server Error in '/' Application.", driver.FindElement(By.CssSelector("h1")).Text);
Since it is just checking for "Server Error in '/' Application.", this is how anti-forgery starts. So my exported results came back as saying there is a YSOD here, when you manually do the steps you do not get an anti-fogery. Now my boss is pissed and thinks my automation scripts are not valuable at all.

Why on earth am I getting an anti-forgery error!? How do I prevent selenium from getting one?

l3l00
Active particpant
Active particpant

Posts : 11
Join date : 2015-01-06

Back to top Go down

Re: C# Anti-Forgery error!?

Post by AgoBalan on Tue Feb 24, 2015 4:07 pm

Are you sure ,whether error is related to selenium.. else browser or site functionality related error?

R u sure By.CssSelector("h1").. focusing to the right target u focus,try highlighting the element with find button in IDE..

AgoBalan
Amateur
Amateur

Posts : 36
Join date : 2015-02-23

Back to top Go down

Re: C# Anti-Forgery error!?

Post by l3l00 on Wed Feb 25, 2015 4:56 am

The assert I added is when a YSOD or an anti-forgery appeared.

I know I have the right element because I have other test cases that use that input search box in the sharepoint iFrame.
It searches by name, by date, by batch number. Then it does the SSN (this is just a search table nothing more and it is grabbing text out of the table and pasting it in the input).

l3l00
Active particpant
Active particpant

Posts : 11
Join date : 2015-01-06

Back to top Go down

Re: C# Anti-Forgery error!?

Post by Sponsored content Today at 7:26 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum