How to select the Chrome context menu option in Ranorex
File: SelectContextMenuOption.UserCode.cs
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using System.Drawing; using System.Threading; using WinForms = System.Windows.Forms; using Ranorex; using Ranorex.Core; using Ranorex.Core.Repository; using Ranorex.Core.Testing; using System.Diagnostics; namespace GlobalProjects { public partial class SelectContextMenuOption { private void Init() { CodeaftLogin(); } public void CodeaftLogin() { Process.Start("chrome.exe","https://codeaft.github.io/testapp/"); repo.Codeaft.Username.Value = "codeaft"; repo.Codeaft.Username.Click(); repo.Codeaft.Username.DoubleClick(); Mouse.Click(WinForms.MouseButtons.Right); Delay.Duration(200); foreach(MenuItem mi in repo.MenuBar.Items) { Report.Info(mi.Text); } foreach(MenuItem mi in repo.MenuBar.Items) { if(mi.Text.Equals("Copy Ctrl+C")) { mi.EnsureVisible(); mi.MoveTo(); mi.Click(); break; } } repo.Codeaft.Password.PressKeys("{LControlKey down}{Vkey}{LControlKey up}"); Delay.Duration(100); repo.Codeaft.Login.Click(); } } }
Comments and Reactions