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

Click with modifier key pressed

1 Answer 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dmitriy
Top achievements
Rank 1
Dmitriy asked on 19 Jul 2013, 09:11 AM
Greetings, Telerik Team!

Is there any way to simulate click on element with modifier key pressed, i.e. Ctrl + Click?

I'm trying to do this so:

var fieldDiv = label.Parent.Parent.Parent.As<HtmlDiv>();
_testHelperBase.CurrentFrame.OwnerBrowser.Desktop.KeyBoard.KeyDown(Keys.Control);
fieldDiv.Click();
_testHelperBase.CurrentFrame.OwnerBrowser.Desktop.KeyBoard.KeyUp(Keys.Control);

with no result.

1 Answer, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 22 Jul 2013, 11:58 AM
Hello Dmitriy,

Thank you for contacting Telerik Support.

You can try with the following code:

var fieldDiv = label.Parent.Parent.Parent;
HtmlDiv divElemen = fieldDiv.As<HtmlDiv>();
Manager.Desktop.KeyBoard.KeyDown(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Ctrl"));
divElemen.Click(false);
Manager.Desktop.KeyBoard.KeyUp(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Ctrl"));

If this doesn't help, in order to help you best:

1. Please provide us with a copy of your test and grant us access to your application so we can reproduce the issue on our end and give you a solution. 

2. If it is not possible to grant us access to your application, please take a Fiddler trace and attach it to a support ticket in a zip file. You can capture a Fiddler trace using FiddlerCap

3. A Jing video demonstrating the issue may also help us to better understand what is happening. 

Looking forward to hearing from you. 


Regards,
Velin Koychev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Dmitriy
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question
or