c# - sendKeys : accesss denied

45 views
Skip to first unread message

Nortier David

unread,
Nov 16, 2023, 8:15:32 AM11/16/23
to seleniu...@googlegroups.com

Olà

 

 

I’ve a test who sends a message with an attachment

For this one, I must type the full path of my pdf file in a dialog box  : SendKeys.SendWait(path + {ENTER})

 

The security on the drive (path) is “Everyone fuul control”

 

The instuction Sendkeys.Sendwait throws an error : access denied !

 

Some help ‘ll be very appreciated 😊

 

 

  David

( 1583

 

 

 


====== DISCLAIMER ======

https://www.cph.be/maildisclaimer

SuperKevy

unread,
Nov 16, 2023, 12:43:50 PM11/16/23
to Selenium Users
What is your path statement looking like?

Nortier David

unread,
Nov 17, 2023, 3:14:05 AM11/17/23
to seleniu...@googlegroups.com

Hello

 

Just D:\Tests_journaliers\TFS

I ‘ve tested another path : \\SRVXXX\Commun\MyCPH Web\Tests\Tests_journaliers

 

Idem

 

 

 

De : seleniu...@googlegroups.com <seleniu...@googlegroups.com> De la part de SuperKevy
Envoyé : jeudi 16 novembre 2023 18:44
À : Selenium Users <seleniu...@googlegroups.com>
Objet : [selenium-users] Re: c# - sendKeys : accesss denied

 

ATTENTION : cet e-mail provient d'une personne externe. Vérifiez toujours l’expéditeur avant d’ouvrir les pièces jointes ou de cliquer sur les liens.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dc265fd6-0cf4-4c1f-8f8f-8c6e60e324a9n%40googlegroups.com.

SuperKevy

unread,
Nov 17, 2023, 1:34:25 PM11/17/23
to Selenium Users
Yep, single slash is creating an escape char.   Consider \\ where they occur. 


On Windows, the backslashes in a file path must always be escaped. For example:

    strFileToOpen = "C:\\Tmp\\notecase_tmp.txt"

But on recent versions of Windows, you may optionally use the forward slash as the path directory delimiter without escaping, just as on Unix/Linux:

  strFileToOpen = "C://Tmp/notecase_tmp.txt"

Nortier David

unread,
Nov 20, 2023, 3:18:22 AM11/20/23
to seleniu...@googlegroups.com

Hello

 

Thank you for your answers

 

But I do

·         SendKeys.SendWait(Path.Combine(ConfigurationManager.AppSettings["TestsDirectory"], ConfigurationManager.AppSettings["PdfDirectory"], "RAT19_12.pdf") + "{ENTER}");

 

So the path is correct, and on my development PC that works.

The problem arises on the PC where the tests are played, via TFS builds

 

 

De : seleniu...@googlegroups.com <seleniu...@googlegroups.com> De la part de SuperKevy
Envoyé : vendredi 17 novembre 2023 19:34
À : Selenium Users <seleniu...@googlegroups.com>
Objet : Re: [selenium-users] Re: c# - sendKeys : accesss denied

Reply all
Reply to author
Forward
0 new messages