YONGFEIUALL

izheyi.com


  • Home

  • Archives

  • Categories

  • Tags

  • About

  • Search

Selenium Webdriver Object Repository and Object Recognition

Posted on 2015-10-12 | In Selenium Webdriver |

In QTP, there is a concept called “Object Repository”. All the objects are added to Object Repository and the objects are used in the test. If there are any changes in the application then we need to update only Object Repository. But in selenium WebDriver, There is no any built-in facility to create object repository. So maintenance of page objects(Page element locators) becomes very hard If you will write all objects of page on code level.

Read more »

再看北京自然博物馆

Posted on 2015-10-11 | In 丁丁 |

国庆期间都没预约到票,就预约到了这个周天。
去年的时候来过一次,感觉很不错,再次来,好像少了一些第一次来的那种新鲜感。



















建国66周年,逛天安门

Posted on 2015-10-06 | In 丁丁 |

中国人民抗日战争暨世界反法西斯战争胜利70周年阅兵后,本来说是要去天安门的,不巧那天刚走到颐和园就下雨了,带着闺女就去中关村图书城看书去了。

Read more »

2015国庆香山游

Posted on 2015-10-01 | In 丁丁 |

今天风是可不小,在山顶都差点没把人给吹走,本来还说坐缆车下来呢,谁知缆车也停了。不过玩的很开心。

Read more »

Dad's birthday

Posted on 2015-09-19 | In 丁丁 |

在爸爸的记忆中,这可能是爸爸收到的第一份生日卡片,谢谢妈妈和小丁的心意,爸爸也爱你们^_^


blog 说明

Posted on 2015-05-01 | In 随想 |

Why have this blog

本人略懒,忘性很大,一直以来都想自己弄个blog记录一下自己学习的笔记和技术参考。

Read more »

Exporting UFT 12 results into html throws the error about 'IDS_BC'

Posted on 2015-01-26 | In QTP |

Exporting UFT 12 results into html throws the error “A reference to variable or parameter ‘IDS_BC’ cannot be resolved.”

I have recently upgraded from QTP 11 to UFT 12. The vbscript I used for QTP 11 worked great, but it is not running with UFT 12.

Read more »

使用Java操作MongoDB - Insert ISODate

Posted on 2014-12-26 | In MongoDB |

We could insert data with json as:

1
2
3
4
5
6
7
8
9
10
11
12
{
"name_collection1": [
{
"attribute_1":"value1",
"attribute_2":"value2"
},

{
"attribute_3":2,
"attribute_4":"value4"
}

]
}

If you want to use ISODate function or any other javascript function you should see how MongoDB Java Driver deals with it. For example in case of ISODate:

1
"bornAt":{ "$date" : "2015-01-05T10:09:15.210Z"}

使用Java操作MongoDB - Query

Posted on 2014-12-25 | In MongoDB |

Query

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Mongo mg = new Mongo("localhost", 27017);
// get db
db = mg.getDB("CRUD");
// get collection
dc = db.getCollection("test");

// findOne
System.out.println(dc.findOne());

// find all
DBCursor cursor = dc.find();
while(cursor.hasNext()){
System.out.println(cursor.next());
}

// display certain column
BasicDBObject keys = new BasicDBObject();
keys.put("name", 1);
keys.put("_id", 0);
DBCursor cursor = dc.find(new BasicDBObject(), keys);
while (cursor.hasNext()) {
System.out.println(cursor.next());
}

// equal | greater | less | not equal | regex
BasicDBObject query = new BasicDBObject();
//query.put("name", "hulu1");
//query.put("number", new BasicDBObject("$gt", 2));
//query.put("number", new BasicDBObject("$gte", 2));
//query.put("number", new BasicDBObject("$lt", 5));
//query.put("number", new BasicDBObject("$lte", 5));
//query.put("name", new BasicDBObject("$ne", "hulu1"));
query.put("name", new BasicDBObject("$regex", "hulu.*"));
DBCursor cursor = dc.find(query);
while (cursor.hasNext()) {
System.out.println(cursor.next());
}

// in | not in
BasicDBObject query = new BasicDBObject();
List<String> list = new ArrayList<String>();
list.add("hulu1");
list.add("hulu4");
query.put("name", new BasicDBObject("$nin", list));
DBCursor cursor = dc.find(query);
while (cursor.hasNext()) {
System.out.println(cursor.next());
}

// and
BasicDBObject query = new BasicDBObject();
query.put("number", new BasicDBObject("$gt", 2));
query.put("name", "hulu1");
DBCursor cursor = dc.find(query);
while (cursor.hasNext()) {
System.out.println(cursor.next());
}

// or
BasicDBObject query = new BasicDBObject();
List<BasicDBObject> obj = new ArrayList<BasicDBObject>();
obj.add(new BasicDBObject("name", "hulu1"));
obj.add(new BasicDBObject("number", new BasicDBObject("$gt", 2)));
query.put("$or", obj);
DBCursor cursor = dc.find(query);
while (cursor.hasNext()) {
System.out.println(cursor.next());
}

使用Java操作MongoDB - Update

Posted on 2014-12-24 | In MongoDB |

Update

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Mongo mg = new Mongo("localhost", 27017);
// get db
db = mg.getDB("CRUD");
// get collection
dc = db.getCollection("test");

//Update
BasicDBObject query = new BasicDBObject();
query.put("name", "hulu22");
query.put("title", "PO");
BasicDBObject newDoc = new BasicDBObject();
newDoc.put("$set", new BasicDBObject("title", "PM").append("name", "hulu22"));// $unset: Removes the specified field from a document.

dc.update(query, newDoc);

dc.update(query, newDoc, false, false);

dc.updateMulti(query, newDoc);

1…313233…40
唐胡璐

唐胡璐

i just wanna live while i am alive

393 posts
42 categories
74 tags
RSS
LinkedIn Weibo GitHub E-Mail
Creative Commons
© 2022 唐胡璐
Powered by Hexo
|
Theme — NexT.Pisces v5.1.4