Share
Go down
l3l00
Active particpant
Active particpant
Posts : 11
Join date : 2015-01-06

C# Anti-Forgery error!?

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?
AgoBalan
Amateur
Amateur
Posts : 36
Join date : 2015-02-23

Re: C# Anti-Forgery error!?

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..
l3l00
Active particpant
Active particpant
Posts : 11
Join date : 2015-01-06

Re: C# Anti-Forgery error!?

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).
Sponsored content

Re: C# Anti-Forgery error!?

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