/// <summary> /// Localiza um elemento pelo Texto /// </summary> /// <param name="tag">Tag do elemento que será localizado</param> /// <param name="propriedade">Atributo que será analisado</param> /// <param name="texto">Texto interno do elemento</param> /// <param name="maximoTentativas">Quantidade máxima de tentativas de localizar o elemento</param> /// <param name="delay">Tempo de espera entre as tentativas</param> /// <param name="lancaExcecao">Permite ou não lançar exceção caso o elemento não seja localizado</param> public List <IWebElement> LocalizaElementosPropriedade(string tag, string propriedade, string texto, int maximoTentativas, int delay, bool lancaExcecao) { int tentativas = 0; List <IWebElement> elementos = new List <IWebElement>(); while (tentativas < maximoTentativas && elementos.Count == 0) { tentativas++; try { foreach (IWebElement e in Navegador.FindElementsByTagName(tag)) { if (e.GetAttribute(propriedade) != null && e.GetAttribute(propriedade).ToUpper().Equals(texto.ToUpper())) { elementos.Add(e); } } if (elementos.Count == 0) { Thread.Sleep(1000 * delay); } } catch { Thread.Sleep(1000 * delay); } } if (elementos.Count == 0 && lancaExcecao) { throw new Exception(string.Format("Não foi possível localizar o elemento contendo a texto {0}", texto)); } return(elementos); }
private void GoProximo(object sender, EventArgs args) { if (Navegador.CanGoForward) { Navegador.GoForward(); } }
private void btnProximo_Click(object sender, EventArgs e) { if (Navegador.CanGoForward) { Navegador.GoForward(); } }
static void Main(string[] args) { var chrome = new Navegador(); chrome.Navegar("www.google.com.br"); chrome.Navegar("www.facebook.com.br"); chrome.Navegar("www.outlook.com"); chrome.Voltar(); chrome.Avancar(); chrome.Voltar(); chrome.Voltar(); chrome.Voltar(); chrome.Voltar(); chrome.Avancar(); chrome.Avancar(); chrome.Avancar(); chrome.Avancar(); chrome.VerHistorico(); Console.Read(); }
private void btnVoltar_Click(object sender, EventArgs e) { if (Navegador.CanGoBack) { Navegador.GoBack(); } }
public void OpenProject(string path, string tipo) { if (tipo == "Ladder") { Nome_do_projeto = Path.GetFileName(path); path_project = Path.GetDirectoryName(path); txt_cmd = path_project + "//" + Nome_do_projeto + "//" + "Debug//cmd.txt"; txt_tipo = path_project + "//" + Nome_do_projeto + "//" + "Tipo//type.txt"; txt_d = path_project + "//" + Nome_do_projeto + "//" + "Debug//flag.txt"; txt_serial = path_project + "//" + Nome_do_projeto + "//" + "Debug//serial.txt"; tabPage2.Text = Nome_do_projeto; abrirexe(); Thread.Sleep(100); Splash_screen s = new Splash_screen(); s.ShowDialog(); System.IO.File.WriteAllText(txt_cmd, "l"); System.IO.File.WriteAllText(txt_d, "1"); bot_ladder(); Navegador.SelectTab(tabPage2); } else { MessageBox.Show("Parametro Incorreto"); } }
private void pIr_Click(object sender, EventArgs e) { Navegador.Navigate(txtUrl.Text); this.barraProgreso.Value = 0; contador = 0; this.timer1.Start(); }
private void VoBT_Clicked(object sender, EventArgs e) { if (Navegador.CanGoBack) { Navegador.GoBack(); } }
/// <summary> /// Localiza um elemento HTML no documento /// </summary> /// <param name="id">ID do elemento a ser localizado</param> /// <param name="maximoTentativas">Quantidade máxima de tentativas de localizar o elemento</param> /// <param name="delay">Tempo de espera entre as tentativas</param> /// <param name="lancaExcecao">Permite ou não lançar exceção caso o elemento não seja localizado</param> public IWebElement LocalizaElemento(string id, int maximoTentativas, int delay, bool lancaExcecao) { IWebElement elemento = null; int tentativas = 0; while (tentativas < maximoTentativas && elemento == null) { tentativas++; try { elemento = Navegador.FindElementById(id); if (elemento == null) { Thread.Sleep(1000 * delay); } } catch { Thread.Sleep(1000 * delay); } } if (elemento == null && lancaExcecao) { throw new Exception(string.Format("Não foi possível localizar o elemento {0}", id)); } return(elemento); }
public void GoVoltar(object sender, EventArgs args) { if (Navegador.CanGoBack == true) { Navegador.GoBack(); } }
private void PrBT_Clicked(object sender, EventArgs e) { if (Navegador.CanGoForward) { Navegador.GoForward(); } }
private void Button_Clicked_proximo(object sender, EventArgs e) { if (Navegador.CanGoForward) { Navegador.GoForward(); } }
private void Button_Clicked_anterior(object sender, EventArgs e) { if (Navegador.CanGoBack) { Navegador.GoBack(); } }
public Login(string Target) { InitializeComponent(); _target = Target; Xpcom.Initialize("Firefox"); GeckoPreferences.User["plugin.state.flash"] = true; GeckoPreferences.User["browser.xul.error_pages.enabled"] = true; GeckoPreferences.User["media.navigator.enabled"] = true; GeckoPreferences.User["media.navigator.permission.disabled"] = true; Navegador.NSSError += (object sender, Gecko.Events.GeckoNSSErrorEventArgs e) => { if (e.Message.Contains("Certificate")) { #pragma warning disable CS0618 // O tipo ou membro é obsoleto CertOverrideService.GetService().RememberRecentBadCert(e.Uri, e.SSLStatus); #pragma warning restore CS0618 // O tipo ou membro é obsoleto Navegador.Navigate(e.Uri.AbsoluteUri); e.Handled = true; } }; Navegador.Navigated += Navegador_Navigated; Navegador.Navigate(_target); Refresh(); }
public void GoProxima(object sender, EventArgs args) { if (Navegador.CanGoForward) { Navegador.GoForward(); } }
public TelaPrincipal() { MudarCores iniciarTema = new MudarCores(); InitializeComponent(); Navegador.Navigate(new Home()); }
private void GoVoltar(object sender, EventArgs args) { if (Navegador.CanGoBack) { Navegador.GoBack(); } }
private async Task <int> test_to_run(MainWindow gui) { for (int i = 0; i < timesToExecute.Value; i++) { if (selectedCase == null) { } else { var controller = await this.mainWindow.ShowProgressAsync("Aguardar Teste...", "Teste em Progresso"); controller.SetIndeterminate(); await Task.Delay(2000); ////mainGrid.IsEnabled = false; ////progressRing.IsActive = true; //selectedCase.run(Convert.ToInt32(velocSlider.Value)); //await controller.CloseAsync(); Navegador nav_selecionado = navegadorSelectBtn.SelectedItem as Navegador; selectedCase.run(Convert.ToInt32(velocSlider.Value), nav_selecionado.cod); await controller.CloseAsync(); } } this.updateWindow(); return(1); }
/// <summary> /// Localiza um elemento pelo Texto /// </summary> /// <param name="tag">Tag do elemento que será localizado</param> /// <param name="texto">Texto interno do elemento</param> /// <param name="maximoTentativas">Quantidade máxima de tentativas de localizar o elemento</param> /// <param name="delay">Tempo de espera entre as tentativas</param> /// <param name="lancaExcecao">Permite ou não lançar exceção caso o elemento não seja localizado</param> public IWebElement LocalizaElementoTexto(string tag, string texto, int maximoTentativas, int delay, bool lancaExcecao) { IWebElement elemento = null; int tentativas = 0; while (tentativas < maximoTentativas && elemento == null) { tentativas++; try { foreach (IWebElement e in Navegador.FindElementsByTagName(tag)) { if (e.Text != null && e.Text.ToUpper().Equals(texto.ToUpper())) { elemento = e; break; } } if (elemento == null) { Thread.Sleep(1000 * delay); } } catch { Thread.Sleep(1000 * delay); } } if (elemento == null && lancaExcecao) { throw new Exception(string.Format("Não foi possível localizar o elemento contendo a texto {0}", texto)); } return(elemento); }
public ActionResult Index() { string login = HttpContext.User.Identity.Name.Split('\\')[1].ToUpper(); List <ProjetoViewModel> listalocal; var navegadorSession = new Navegador(); Session["Nav"] = navegadorSession; ViewBag.SiglaUser = login; Session["NivelCorrente"] = 0; ViewBag.Title = "Projeto"; Session["BOTOES"] = new LayoutSession(); using (var contextoProjeto = DIContainer.Instance.AppContainer.Resolve <AppServiceBase <Projeto> >()) { contextoProjeto.Start(); //_banco); var listaprojetos = contextoProjeto.Query().OrderBy(x => x.NUMERO).ToList(); listalocal = Mapper.Map <IEnumerable <ProjetoViewModel> >(listaprojetos).ToList(); } ViewBag.ListaProjetos = new SelectList(listalocal, "GUID", "NUMERO"); TempData["LayoutUsuario"] = "_LayoutProjeto"; return(View()); }
public JsonResult Buscar(int idNavegador, int idProjeto) { NavegadorBusiness navBus = new NavegadorBusiness(); Navegador navegador = navBus.Buscar(idNavegador, idProjeto); return(Json(navegador, JsonRequestBehavior.AllowGet)); }
public static void Main() { Gtk.Application.Init(); Navegador nav = new Navegador(); Gtk.Application.Run(); }
private void GoProximo(object sender, EventArgs e) { //Verifica se o usuario clicou no botão de voltar e quer voltar para a pagina acessada anteriormente if (Navegador.CanGoForward) { Navegador.GoForward(); } }
// Metodo para realizar acao da escolha do usuario de acordo com e-mail selecionado. public void opcao(string resposta) { leituraArquivo = GameObject.Find("LeituraArquivo").GetComponent <LeituraArquivo>() as LeituraArquivo; // Se o e-mail nao foi respondido. if (!isRespondido) { // Busco e-mail, em seguida envio como parametro sua resposta e altero o estado para respondido. this.getEmail(resposta); if (resposta.Equals("aceitar")) { int idProjeto = 0; //Debug.Log ("IdProjeto: " + leituraArquivo.IdProjetoEmail (idEmail)); int.TryParse(leituraArquivo.IdProjetoEmail(idEmail), out idProjeto); if (idProjeto != 0) { Projeto.aumentaQtdProjetos(); //Debug.Log ("Quantidade projetos: " + Projeto.getQtdProjetos ()); //Debug.Log ("Projeto " + Projeto.getQtdProjetos ().ToString ()); Projeto p = GameObject.Find("TelaEstacaoTrabalho").transform.FindChild("TelaInicial/Projeto " + Projeto.getQtdProjetos().ToString()).GetComponent <Projeto> () as Projeto; p.criarProjeto(idProjeto); } else { //Debug.Log ("E-mail nao possui um projeto"); } this.transform.FindChild("UI/Canvas/Respostas").gameObject.SetActive(false); this.transform.FindChild("UI/Canvas/Aceito").gameObject.SetActive(true); // leitura do arquivo de Email.xml leituraArquivo.CarregarArquivo(); //Debug.Log ("clicou para aceitar o email " + idEmail); } else if (resposta.Equals("recusar")) { this.transform.FindChild("UI/Canvas/Respostas").gameObject.SetActive(false); this.transform.FindChild("UI/Canvas/Recusado").gameObject.SetActive(true); Navegador.AdicionarListaNoticias(idEmail); Desempenho.AddProjeto(idEmail, 0, false); } else { //Debug.Log ("Opçao invalida."); } // Marco a resposta da tela atual para respondido e invalidando acesso aos botoes da tela. this.isRespondido = true; } else { //Debug.Log("Este e-mail ja foi respondido e portanto os botoes ficaram sem acao."); } }
protected override void OnNavigatedFrom(NavigationEventArgs e) { Navegador page = e.Content as Navegador; if (page != null) { page.rssG = rss; } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { try { Navegador.Navigate("https://app.powerbi.com/"); } catch (Exception w) { MessageBox.Show("error al cargar:" + w); } }
// GET: Lista public ActionResult Index(int?nivel, string guid) { string login = HttpContext.User.Identity.Name.Split('\\')[1].ToUpper(); _navegadorSession = (Navegador)Session["Nav"]; if (nivel == null) { nivel = (int)Session["NivelCorrente"]; } _navegadorSession.OperaNivel(nivel, guid); var numeroDocumento = string.Empty; if (Session["NumeroDocumento"] != null) { numeroDocumento = (string)Session["NumeroDocumento"]; } if (nivel > 2) { if (_navegadorSession.PlanilhaEscolhida == null) { ViewBag.DocumentoAtivado = false; Session["NivelCorrente"] = nivel; ViewBag.SiglaUser = login; return(View()); } else if (_navegadorSession.PlanilhaEscolhida != null) { if (string.IsNullOrEmpty(numeroDocumento)) { ViewBag.DocumentoAtivado = false; ViewBag.SiglaUser = login; return(RedirectToAction("LTemplate", "Lista", new { guidPlanilha = _navegadorSession.PlanilhaEscolhida.GUID })); } } } else { ViewBag.DocumentoAtivado = false; Session["NivelCorrente"] = nivel; ViewBag.SiglaUser = login; return(View()); } return(View()); }
internal Navegador Buscar(int idNavegador, int idProjeto) { Comando comando = null; Comando comandoGeo = null; Navegador navegador = null; IDataReader reader = null; try { string schemaUsuarioGeo = ConfigurationManager.AppSettings["SchemaUsuarioGeo"].ToUpper(); BancoDeDados bancoDeDadosGeo = BancoDeDadosFactory.CriarBancoDeDados("StringConexaoGeo"); comandoGeo = bancoDeDadosGeo.GetComandoSql(@"select a.nome from " + schemaUsuarioGeo + @".tab_navegador a where a.id = :id "); comandoGeo.AdicionarParametroEntrada("id", idNavegador, DbType.Int32); reader = bancoDeDadosGeo.ExecutarReader(comandoGeo); if (reader.Read()) { navegador = new Navegador(); navegador.Id = idNavegador; navegador.Nome = Convert.ToString(reader["nome"]); } if (navegador != null) { List <string> projetosAssociados; navegador.Servicos = BuscarServicos(idNavegador); navegador.Cenarios = BuscarCenarios(idNavegador); navegador.Filtros = BuscarFiltrosLayerFeicao(idNavegador, idProjeto, out projetosAssociados); if (projetosAssociados != null) { navegador.ProjetosAssociados = projetosAssociados.ToArray(); } } } finally { if (comando != null) { comando.Dispose(); } if (comandoGeo != null) { comandoGeo.Dispose(); } if (reader != null) { reader.Close(); reader.Dispose(); } } return(navegador); }
public ActionResult Index() { //string login = HttpContext.User.Identity.Name.Split('\\')[1].ToUpper(); var navegadorSession = new Navegador(); var listaProjetos = _qryProjetos.GetProjetoToLists(); ViewBag.ListaProjetos = new SelectList(listaProjetos, "GUID", "NUMERO"); return(View()); }
static void Main(string[] args) { var navegador = new Navegador(); navegador.NavegarPara("Google.com"); navegador.NavegarPara("Caelum.com.br"); navegador.NavegarPara("Alura.com.br"); navegador.Aterior(); navegador.Aterior(); navegador.Aterior(); navegador.Aterior(); navegador.Proximo(); }
/// <summary> /// Encerra o google chrome /// </summary> public void EncerraNavegador() { try { Navegador.Quit(); //System.Diagnostics.Process[] chromeProcesses = System.Diagnostics.Process.GetProcessesByName("chrome"); //foreach (var chromeProcess in chromeProcesses) //{ // chromeProcess.Kill(); //} } catch { } }
private static void AbrirNavegador(Navegador navegador) { switch (navegador) { case Navegador.Chrome: WebDriver = ObterChrome(); break; case Navegador.InternetExplorer: WebDriver = ObterInternetExplorerDriver(); break; case Navegador.Firefox: WebDriver = new FirefoxDriver(); break; } }
public static IWebDriver ObterNavegadorWebDriver(Navegador navegador) { AbrirNavegador(navegador); return WebDriver; }