Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

C# Anti-Forgery error!? Empty C# Anti-Forgery error!?

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

C# Anti-Forgery error!? Empty Re: C# Anti-Forgery error!?

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

C# Anti-Forgery error!? Empty Re: C# Anti-Forgery error!?

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

C# Anti-Forgery error!? Empty Re: C# Anti-Forgery error!?

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