5 different ways to refresh a webpage using Selenium Webdriver

 
Here are the 5 different ways, using which we can refresh a webpage.There might be even more :)

There is no special extra coding. I have just used the existing functions in different ways to get it work. Here they are :

1.Using sendKeys.Keys method

    driver.get("https://accounts.google.com/SignUp");
driver.findElement(By.id("firstname-placeholder")).sendKeys(Keys.F5);

2.Using navigate.refresh()  method

    driver.get("https://accounts.google.com/SignUp");
driver.navigate().refresh();

3.Using navigate.to() method

    driver.get("https://accounts.google.com/SignUp");
driver.navigate().to(driver.getCurrentUrl());

4.Using get() method

    driver.get("https://accounts.google.com/SignUp");
driver.get(driver.getCurrentUrl());

5.Using sendKeys() method

    driver.get("https://accounts.google.com/SignUp");
driver.findElement(By.id("firstname-placeholder")).sendKeys("\uE035");

[Selenium]刷新页面 Refresh page的更多相关文章

  1. selenium 的页面对象模型Page Object

    页面对象模型page object model是selenium中的一种脚本设计模式,它能将页面元素封装起来,与业务操作分隔开, 在页面变化改变时,无需去修改业务逻辑代码,提高脚本维护的效率. 1.p ...

  2. JSP简单练习-定时刷新页面

    <%@ page contentType="text/html; charset=gb2312" %> <%@ page import="java.ut ...

  3. javascript refresh page 几种页面刷新的方法

    Javascript刷新页面的几种方法:1    history.go(0) 2    location.reload() 3    location=location 4    location.a ...

  4. Python+Selenium自动化-设置浏览器大小、刷新页面、前进和后退

    Python+Selenium自动化-设置浏览器大小.刷新页面.前进和后退   1.设置浏览器大小 maximize_window():设置浏览器大小为全屏 set_window_size(500,5 ...

  5. react+antd分页 实现分页及页面刷新时回到刷新前的page

    antd框架地址:https://ant.design/index-cn 利用antdUI框架做了个分页,其他功能都没问题,但是页面跳转后刷新会回到第一页,经过学习,在组件里增加了hash值,详情请看 ...

  6. 纯HTML自动刷新页面或重定向(http-equiv属性的refresh)

    refresh 属性值  --  刷新与跳转(重定向)页面 refresh出现在http-equiv属性中,使用content属性表示刷新或跳转的开始时间与跳转的网址 refresh示例一:5秒之后刷 ...

  7. 利用js刷新页面方法

    1,reload 方法,该方法强迫浏览器刷新当前页面. location.reload(force) 如果该方法没有规定参数,或者参数是 false,它就会用 HTTP 头 If-Modified-S ...

  8. Servlet自动刷新页面

    以下内容引用自http://wiki.jikexueyuan.com/project/servlet/auto-refresh.html: 假设一个Web页面,显示了现场比赛得分或股票市场状况或货币兑 ...

  9. 使用jquery结合ajax做下拉刷新页面,上拉加载页面,俗称分页

    jquery结合iscroll.js做下拉刷新页面,上拉加载页面 先上代码,里面都有注释这就不一一说明了 <!DOCTYPE html> <html lang="en&qu ...

随机推荐

  1. 20155224 2016-2017-2 《Java程序设计》第8周学习总结

    20155224 2016-2017-2 <Java程序设计>第X周学习总结 教材学习内容总结 第十四章 NIO使用频道(Channel)来衔接数据节点,在处理数据时,NIO可以设定缓冲区 ...

  2. 解决 The word is not correctly spelled问题

    The word is not correctly spelled 此问题是eclipse校验单词拼写造成,如果出在配置文件中,一般会影响到程序的正常执行 解决方法:Window--Preferenc ...

  3. Python学习思维导图

     刚学习Python时,边学边总结的,采用思维导图的形式, 适合回顾使用.内容参考<Python:从入门到实践>一书.   再给出一张Datacamp网站上的一张关于Python基础的总结 ...

  4. Programming Languages: Application and Interpretation

    http://cs.brown.edu/courses/cs173/2012/book/ 1 Introduction 1.1 Our Philosophy 1.2 The Structure of ...

  5. Haroopad安装与配置: Linux系统下最好用的Markdown编辑器

    1. Haroopad概述 Haroopad is a markdown enabled document processor for creating web-friendly documents. ...

  6. wiremock 模拟服务接口提供前端使用

    前后端分离同步开发时,如果前端需要等后端把接口都开发完了再去动工的话,项目周期会拉长. 以前开发时,一般前期是先把接口文档写的差不多了,要么是让前端自己构造模拟数据,要么是后端在开个控制器专门提供模拟 ...

  7. 设置pip镜像源

    修改镜像源 vim ~/.pip/pip.conf windows 当前用户目录\pip\pip.ini 内容 [global] index-url=https://pypi.tuna.tsinghu ...

  8. 腾讯EC .net API对接第三方系统

    最近公司销售部门用到了腾讯EC,实现公司内部OA系统与腾讯ec的数据同步,要求如下: 1.OA内部系统账号与腾讯ec登陆账号同步 2.首先做义工客户端工具用来把现有客户导入到EC,销售人员的客户信息与 ...

  9. 黄聪:C#使用能够foreach对hashtable、List遍历时“集合已修改;可能无法执行枚举操作。”错误

    解决办法:使用for循环,而不是foreach循环 例如: ArrayList akeys=new ArrayList(_transmit_tb.Keys); ;p> -;p--) { _tra ...

  10. linux编程基本

    库的使用头文件:.h 里面的函数及变量的声明 比如#include <stdio.h> ,Linux下默认头文件的搜索路径 系统定义的头文件: /usr/include /usr/loca ...